Hi Chris,
Fortunately, this is me, so these DICOMS are posted publicly for my students to use. Here's the dataset: https://osf.io/mqgzh
Since I'm running on mac, I don't have to worry about the ownership issue.
I went inside the container:
docker run -ti -v ${PWD}/out:/nifti_dir -v ${PWD}/out/dcm:/output_dir -v ${PWD}/T1_mprage_1mm_13:/original_dicom_dir mri_reface
Then I went to the root and made sure all the bind mounts worked (they looked good)
Conversion works if I specify the NiFTI file to convert, but not if I specify just the directory containing it:
root@0cef076d50e6:/# /usr/bin/mlrtapp/ADIR_nii2dicom nifti_dir/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii output_dir
WARNING: Study Instance UID not found, generating new UID.
WARNING: Frame Instance UID not found, generating new UID.
Finished writing 256 dcm files to outDir: output_dir
The dcm files have tags and I can convert them to NIfTI with dcm2niix so this seems to succeed!
________
However, if I try to additionally specify the originalDicomDir, I get an error:
root@797ec2f975da:/# /usr/bin/mlrtapp/ADIR_nii2dicom nifti_dir/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii output_dir original_dicom_dir
Traceback (most recent call last):
File "/usr/bin/mlrtapp/ADIR_nii2dicom", line 72, in <module>
nii2dicom(args['<nii>'], args['<outDir>'], args['<originalDicomDir>'],verbose=args.get('--verbose',False),sliceDim=int(args.get('--sliceDim')),modality_default=str(args.get('--modality')),manufacturer_default=str(args.get('--manufacturer')),photometric_default=str(args.get('--photometric')),dry_run=args.get('--dry-run',False),uid_root=str(args.get('--UID_ROOT')),seriesNUM_select=args.get('--seriesNUM_select',None),seriesUID_select=args.get('--seriesUID_select',None))
File "/usr/bin/mlrtapp/image_handling/ADIR_nii2dicom.py", line 110, in nii2dicom
dicom_0 = dicom.dcmread(gzip.open(dcmfiles[0],mode='rb')) if(dcmfiles[0][-3:] == '.gz') else dicom.dcmread(dcmfiles[0])
IndexError: list index out of range
If I try from outside the container, I also have less luck, even though I am only specifying the NIfTI image and the output directory, as I did inside the container:
dpat@saci 219 % docker run -ti -v ${PWD}/out:/nifti_dir -v ${PWD}/out/dcm:/output_dir mri_reface /usr/bin/mlrtapp/ADIR_nii2dicom nifti_dir/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii output_dir
Traceback (most recent call last):
File "/usr/bin/mlrtapp/ADIR_nii2dicom", line 72, in <module>
nii2dicom(args['<nii>'], args['<outDir>'], args['<originalDicomDir>'],verbose=args.get('--verbose',False),sliceDim=int(args.get('--sliceDim')),modality_default=str(args.get('--modality')),manufacturer_default=str(args.get('--manufacturer')),photometric_default=str(args.get('--photometric')),dry_run=args.get('--dry-run',False),uid_root=str(args.get('--UID_ROOT')),seriesNUM_select=args.get('--seriesNUM_select',None),seriesUID_select=args.get('--seriesUID_select',None))
File "/usr/bin/mlrtapp/image_handling/ADIR_nii2dicom.py", line 76, in nii2dicom
nii = nib.load(niifile)
File "/usr/local/lib/python2.7/dist-packages/nibabel/loadsave.py", line 42, in load
This is as far as I've gotten. I appreciate your time.
-Dianne
Threaded View
Title | Author | Date |
---|---|---|
Dianne Patterson | May 24, 2023 | |
Sun Sar | Dec 9, 2024 | |
Christopher Schwarz | Dec 9, 2024 | |
Christopher Schwarz | May 30, 2023 | |
Dianne Patterson | May 31, 2023 | |
Dianne Patterson | May 29, 2023 | |
Dianne Patterson | May 25, 2023 | |
Christopher Schwarz | May 26, 2023 | |
Dianne Patterson | May 28, 2023 | |
Christopher Schwarz | Jun 6, 2023 | |
Dianne Patterson | Jun 6, 2023 | |
Christopher Schwarz | Jun 7, 2023 | |
Dianne Patterson | Jun 9, 2023 | |
Christopher Schwarz | Jun 13, 2023 | |
Adam Raikes | Nov 2, 2023 | |
Christopher Schwarz | Nov 17, 2023 | |
Christopher Schwarz | May 25, 2023 | |
Christopher Schwarz | May 24, 2023 | |