open-discussion
open-discussion > RE: Trying Docker version
May 25, 2023 10:05 PM | Dianne Patterson
RE: Trying Docker version
Dear Christopher,
Thank you so much for directing me to the correct way to download the Docker image! For NIfTI refacing, I ran it quite successfully using your bash script on my Mac.
However, my attempt to do dicom-to-dicom refacing failed to create revised dicoms on my machine, although the message below claims the files were written to temp. The DICOM conversion DID create the NIfTI output.
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.png
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.png
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_Affine.txt
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_InverseWarp.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_Warp.nii
and it created an additional directory "dcm", but it is empty.
Is this a bind mount issue, or am I missing an option?
dpat@saci 219 % run_mri_reface_docker.sh T1_mprage_1mm_13 out -imType T1
You provided a directory for an input, rather than a nii file. We will assume it contains DICOM for a single series. Using the -imType flag is highly recommended with this workflow.
Running dcm2niix to convert to nii
Chris Rorden's dcm2niiX version v1.0.20230411 (JP2:OpenJPEG) (JP-LS:CharLS) GCC8.4.0 x86-64 (64-bit Linux)
Found 176 DICOM file(s)
Convert 176 DICOM as /tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13 (256x256x176x1)
Conversion required 1.763774 seconds (0.552646 for core code).
'/tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii' -> '/var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii'
-------------------------------------------------------
Running mri_reface, version 0.3.2
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tpd3f669d5_b341_40d7_a590_73886f1cb92c
Target file: /tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii
Output directory: /var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs
Target image type: T1
Template: /root/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceTemplate_T1.nii
Face atlas: /root/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceMask.nii
Calculating affine parameters to template. This will take some time.
Using face-optimized affine.
Estimating warp to template using ANTS. This will take a while.
Transforming images to input space using antsApplyTransforms
Finding face regions using the atlas
Matching intensities of warped-template to input (DBC)
Adding Rician noise to template to match noise levels in input image, with multiplier 1
Estimated noise PSF: 0
Noise in target image norm region: 6.187167 (2.791533%)
Noise in template image norm region: 2.160575 (0.974810%)
Noise to add: 5.797668 (2.615798%)
Noise in target image air: 0.440074 (16.009274%)
Noise in template image air: 0.027489 (1.000019%)
Noise to add in air: 0.439215 (210.910828%))
Replacing face
Replacing air
Saving outputs
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii
Generating renders for QC use
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.png
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.png
ADIR_ReFace finished in: 20.571 minutes
Traceback (most recent call last):
File "/usr/bin/mlrtapp/ADIR_nii2dicom", line 72, in
nii2dicom(args[''], args[''], args[''],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
DICOM file directory is empty.
De-faced DICOM was written to /var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs/dcm. This DICOM metadata is NOT otherwise de-identified. Only de-facing was performed. If you need the meta-data de-identified also, you should run it through your preferred DICOM de-identification software.
Thank you for your time and the great project!
-Dianne
Thank you so much for directing me to the correct way to download the Docker image! For NIfTI refacing, I ran it quite successfully using your bash script on my Mac.
However, my attempt to do dicom-to-dicom refacing failed to create revised dicoms on my machine, although the message below claims the files were written to temp. The DICOM conversion DID create the NIfTI output.
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.png
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.png
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_Affine.txt
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_InverseWarp.nii
T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_to_MCALT_FaceTemplate_Warp.nii
and it created an additional directory "dcm", but it is empty.
Is this a bind mount issue, or am I missing an option?
dpat@saci 219 % run_mri_reface_docker.sh T1_mprage_1mm_13 out -imType T1
You provided a directory for an input, rather than a nii file. We will assume it contains DICOM for a single series. Using the -imType flag is highly recommended with this workflow.
Running dcm2niix to convert to nii
Chris Rorden's dcm2niiX version v1.0.20230411 (JP2:OpenJPEG) (JP-LS:CharLS) GCC8.4.0 x86-64 (64-bit Linux)
Found 176 DICOM file(s)
Convert 176 DICOM as /tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13 (256x256x176x1)
Conversion required 1.763774 seconds (0.552646 for core code).
'/tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii' -> '/var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii'
-------------------------------------------------------
Running mri_reface, version 0.3.2
By: Christopher G. Schwarz schwarz.christopher@mayo.edu
Temp directory: /tmp/tpd3f669d5_b341_40d7_a590_73886f1cb92c
Target file: /tmp/tmp.0Ck14wBMpy/T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.nii
Output directory: /var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs
Target image type: T1
Template: /root/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceTemplate_T1.nii
Face atlas: /root/.mcrCache9.12/mri_re0/mri_reface/images/MCALT_FaceMask.nii
Calculating affine parameters to template. This will take some time.
Using face-optimized affine.
Estimating warp to template using ANTS. This will take a while.
Transforming images to input space using antsApplyTransforms
Finding face regions using the atlas
Matching intensities of warped-template to input (DBC)
Adding Rician noise to template to match noise levels in input image, with multiplier 1
Estimated noise PSF: 0
Noise in target image norm region: 6.187167 (2.791533%)
Noise in template image norm region: 2.160575 (0.974810%)
Noise to add: 5.797668 (2.615798%)
Noise in target image air: 0.440074 (16.009274%)
Noise in template image air: 0.027489 (1.000019%)
Noise to add in air: 0.439215 (210.910828%))
Replacing face
Replacing air
Saving outputs
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.nii
Generating renders for QC use
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13.png
Saved: T1_mprage_1mm_13_T1_mprage_1mm_20180706110327_13_deFaced.png
ADIR_ReFace finished in: 20.571 minutes
Traceback (most recent call last):
File "/usr/bin/mlrtapp/ADIR_nii2dicom", line 72, in
nii2dicom(args[''], args[''], args[''],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
DICOM file directory is empty.
De-faced DICOM was written to /var/folders/34/ylkzx8hn52q2p5d_23pc90ww0000gn/T/tmp.Mf9RI3jY/outputs/dcm. This DICOM metadata is NOT otherwise de-identified. Only de-facing was performed. If you need the meta-data de-identified also, you should run it through your preferred DICOM de-identification software.
Thank you for your time and the great project!
-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 | |