ubccr / software-layer

CCR Software Layer
GNU General Public License v2.0
3 stars 6 forks source link

dcm2nii #326

Closed pelangho14 closed 4 months ago

pelangho14 commented 4 months ago

I would like to get dcm2nii installed in the server, which is a very essential software for my project.

pelangho14 commented 4 months ago

dcm2nii is a part of MRIcron.

tonykew commented 4 months ago

dcm2niix is already installed - is this not the same thing?

login2$ module spider dcm2niix

----------------------------------------------------------------------------
  dcm2niix: dcm2niix/1.0.20230411
----------------------------------------------------------------------------
    Description:
      dcm2niix is designed to convert neuroimaging data from the DICOM
      format to the NIfTI format.

    Properties:
      Bioinformatic libraries/apps

    You will need to load all module(s) on any one of the lines below before the "dcm2niix/1.0.20230411" module is available to load.

      gcccore/11.2.0
[...]
login2$ module load gcccore/11.2.0 dcm2niix/1.0.20230411
login2$ ls ${EBROOTDCM2NIIX}/bin
dcm2niibatch  dcm2niix
login2$ 

e.g.

login2$ dcm2niix
Chris Rorden's dcm2niiX version v1.0.20230411  GCC11.2.0 x86-64 (64-bit Linux)
usage: dcm2niix [options] <in_folder>
 Options :
  -1..-9 : gz compression level (1=fastest..9=smallest, default 6)
  -a : adjacent DICOMs (images from same series always in same folder) for faster conversion (n/y, default n)
  -b : BIDS sidecar (y/n/o [o=only: no NIfTI], default y)
   -ba : anonymize BIDS (y/n, default y)
  -c : comment stored in NIfTI aux_file (up to 24 characters e.g. '-c VIP', empty to anonymize e.g. 0020,4000 e.g. '-c ""')
  -d : directory search depth. Convert DICOMs in sub-folders of in_folder? (0..9, default 5)
  -e : export as NRRD (y) or MGH (o) or JSON/JNIfTI (j) or BJNIfTI (b) instead of NIfTI (y/n/o/j/b, default n)
  -f : filename (%a=antenna (coil) name, %b=basename, %c=comments, %d=description, %e=echo number, %f=folder name, %g=accession number, %i=ID of patient, %j=seriesInstanceUID, %k=studyInstanceUID, %m=manufacturer, %n=name of patient, %o=mediaObjectInstanceUID, %p=protocol, %r=instance number, %s=series number, %t=time, %u=acquisition number, %v=vendor, %x=study ID; %z=sequence name; default '%f_%p_%t_%s')
  -g : generate defaults file (y/n/o/i [o=only: reset and write defaults; i=ignore: reset defaults], default n)
  -h : show help
  -i : ignore derived, localizer and 2D images (y/n, default n)
  -l : losslessly scale 16-bit integers to use dynamic range (y/n/o [yes=scale, no=no, but uint16->int16, o=original], default o)
  -m : merge 2D slices from same series regardless of echo, exposure, etc. (n/y or 0/1/2, default 2) [no, yes, auto]
  -n : only convert this series CRC number - can be used up to 16 times (default convert all)
  -o : output directory (omit to save to input folder)
  -p : Philips precise float (not display) scaling (y/n, default y)
  -q : only search directory for DICOMs (y/l/n, default y) [y=show number of DICOMs found, l=additionally list DICOMs found, n=no]
  -r : rename instead of convert DICOMs (y/n, default n)
  -s : single file mode, do not convert other images in folder (y/n, default n)
  -u : up-to-date check
  -v : verbose (n/y or 0/1/2, default 0) [no, yes, logorrheic]
  -w : write behavior for name conflicts (0,1,2, default 2: 0=skip duplicates, 1=overwrite, 2=add suffix)
  -x : crop 3D acquisitions (y/n/i, default n, use 'i'gnore to neither crop nor rotate 3D acquistions)
  -z : gz compress images (y/o/i/n/3, default n) [y=pigz, o=optimal pigz, i=internal:miniz, n=no, 3=no,3D]
  --big-endian : byte order (y/n/o, default o) [y=big-end, n=little-end, o=optimal/native]
  --progress : Slicer format progress information (y/n, default n)
  --ignore_trigger_times : disregard values in 0018,1060 and 0020,9153
  --terse : omit filename post-fixes (can cause overwrites)
  --version : report version
  --xml : Slicer format features
 Defaults file : /user/tonykew/.dcm2nii.ini
 Examples :
  dcm2niix /Users/chris/dir
  dcm2niix -c "my comment" /Users/chris/dir
  dcm2niix -o /users/cr/outdir/ -z y ~/dicomdir
  dcm2niix -f %p_%s -b y -ba n ~/dicomdir
  dcm2niix -f mystudy%s ~/dicomdir
  dcm2niix -o "~/dir with spaces/dir" ~/dicomdir
login2$ 
pelangho14 commented 4 months ago

No, I think that is the updated or new version. I need dcm2nii (older version) only

pelangho14 commented 4 months ago

Yes, dcm2niix is already there but I will need dcm2nii since my MATLAB code is written to understand dcm2nii. If I'm going to use dcm2niix, I will have to change my MATLAB code which is going to be time consuming and a bit complicated process. Kindly help me with installing dcm2nii.

Thanks, Praveena


From: Tony Kew @.> Sent: 06 June 2024 15:14 To: ubccr/software-layer @.> Cc: Praveena Elanghovan @.>; Author @.> Subject: Re: [ubccr/software-layer] dcm2nii (Issue #326)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

dcm2niix is already installed - is this not the same thing?

login2$ module spider dcm2niix


dcm2niix: dcm2niix/1.0.20230411

Description:
  dcm2niix is designed to convert neuroimaging data from the DICOM
  format to the NIfTI format.

Properties:
  Bioinformatic libraries/apps

You will need to load all module(s) on any one of the lines below before the "dcm2niix/1.0.20230411" module is available to load.

  gcccore/11.2.0

[...] login2$ module load gcccore/11.2.0 dcm2niix/1.0.20230411 login2$ ls ${EBROOTDCM2NIIX}/bin dcm2niibatch dcm2niix login2$

e.g.

login2$ dcm2niix Chris Rorden's dcm2niiX version v1.0.20230411 GCC11.2.0 x86-64 (64-bit Linux) usage: dcm2niix [options] Options : -1..-9 : gz compression level (1=fastest..9=smallest, default 6) -a : adjacent DICOMs (images from same series always in same folder) for faster conversion (n/y, default n) -b : BIDS sidecar (y/n/o [o=only: no NIfTI], default y) -ba : anonymize BIDS (y/n, default y) -c : comment stored in NIfTI aux_file (up to 24 characters e.g. '-c VIP', empty to anonymize e.g. 0020,4000 e.g. '-c ""') -d : directory search depth. Convert DICOMs in sub-folders of infolder? (0..9, default 5) -e : export as NRRD (y) or MGH (o) or JSON/JNIfTI (j) or BJNIfTI (b) instead of NIfTI (y/n/o/j/b, default n) -f : filename (%a=antenna (coil) name, %b=basename, %c=comments, %d=description, %e=echo number, %f=folder name, %g=accession number, %i=ID of patient, %j=seriesInstanceUID, %k=studyInstanceUID, %m=manufacturer, %n=name of patient, %o=mediaObjectInstanceUID, %p=protocol, %r=instance number, %s=series number, %t=time, %u=acquisition number, %v=vendor, %x=study ID; %z=sequence name; default '%f%p%t%s') -g : generate defaults file (y/n/o/i [o=only: reset and write defaults; i=ignore: reset defaults], default n) -h : show help -i : ignore derived, localizer and 2D images (y/n, default n) -l : losslessly scale 16-bit integers to use dynamic range (y/n/o [yes=scale, no=no, but uint16->int16, o=original], default o) -m : merge 2D slices from same series regardless of echo, exposure, etc. (n/y or 0/1/2, default 2) [no, yes, auto] -n : only convert this series CRC number - can be used up to 16 times (default convert all) -o : output directory (omit to save to input folder) -p : Philips precise float (not display) scaling (y/n, default y) -q : only search directory for DICOMs (y/l/n, default y) [y=show number of DICOMs found, l=additionally list DICOMs found, n=no] -r : rename instead of convert DICOMs (y/n, default n) -s : single file mode, do not convert other images in folder (y/n, default n) -u : up-to-date check -v : verbose (n/y or 0/1/2, default 0) [no, yes, logorrheic] -w : write behavior for name conflicts (0,1,2, default 2: 0=skip duplicates, 1=overwrite, 2=add suffix) -x : crop 3D acquisitions (y/n/i, default n, use 'i'gnore to neither crop nor rotate 3D acquistions) -z : gz compress images (y/o/i/n/3, default n) [y=pigz, o=optimal pigz, i=internal:miniz, n=no, 3=no,3D] --big-endian : byte order (y/n/o, default o) [y=big-end, n=little-end, o=optimal/native] --progress : Slicer format progress information (y/n, default n) --ignore_triggertimes : disregard values in 0018,1060 and 0020,9153 --terse : omit filename post-fixes (can cause overwrites) --version : report version --xml : Slicer format features Defaults file : /user/tonykew/.dcm2nii.ini Examples : dcm2niix /Users/chris/dir dcm2niix -c "my comment" /Users/chris/dir dcm2niix -o /users/cr/outdir/ -z y ~/dicomdir dcm2niix -f %p%s -b y -ba n ~/dicomdir dcm2niix -f mystudy%s ~/dicomdir dcm2niix -o "~/dir with spaces/dir" ~/dicomdir login2$

— Reply to this email directly, view it on GitHubhttps://github.com/ubccr/software-layer/issues/326#issuecomment-2153487647, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJACC34TAKHK4ESBF6TTVALZGDNK7AVCNFSM6AAAAABI5JQM62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGQ4DONRUG4. You are receiving this because you authored the thread.Message ID: @.***>

tonykew commented 4 months ago

Dear Praveena, There is no EasyConfig file for "dcm2nii" (the MRIcron-1.0.20180614.eb EasyConfig is a binary download of MRIcron with dcm2niix)

"dcm2nii" is only available as a binary tarball download The file is "lx.zip" under the "MRIcron/NPM/dcm2nii 2MAY2016" section of this page: https://www.nitrc.org/frs/?group_id=152

You will have to accept the license to download:

Copyright (c) 2016, Chris Rorden
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Since this is a binary only distribution it may well not run at the Center.

"dcm2nii" itself has no external library dependencies, so this might work, as long as it doesn't use the other binaries: dcm2niigui, mricron and npm

$ lddtree ./dcm2nii
dcm2nii => ./dcm2nii (interpreter => none)
$ 
$ ./dcm2nii   
Chris Rorden's dcm2nii :: 2MAY2016 64bit BSD License  :: (upgrade to dcm2niix suggested)
Either drag and drop or specify command line options:
  dcm2nii <options> <sourcenames>
OPTIONS:
-4 Create 4D volumes, else DTI/fMRI saved as many 3D volumes: Y,N = Y
-3 Create planar RGB images: Y,N = N
-a Anonymize [remove identifying information]: Y,N = Y
-b Load settings from specified inifile, e.g. '-b C:\set\t1.ini'  
-c Collapse input folders: Y,N = Y
-d Date in filename [filename.dcm -> 20061230122032.nii]: Y,N = Y
-e Events (series/acq) in filename [filename.dcm -> s002a003.nii]: Y,N = Y
-f Source filename [e.g. filename.par -> filename.nii]: Y,N = N
-g Gzip output, filename.nii.gz [ignored if '-n n']: Y,N = Y
-i ID  in filename [filename.dcm -> johndoe.nii]: Y,N = N
-k sKip initial n volumes in fMRI, e.g. '-k 2':  = 0
-l pLanar RGB (Y=old Analyze; N=new VTK NIfTI): Y,N = N
-m Manually prompt user to specify output format [NIfTI input only]: Y,N = Y
-n Output .nii file [if no, create .hdr/.img pair]: Y,N = Y
-o Output Directory, e.g. 'C:\TEMP' (if unspecified, source directory is used)
-p Protocol in filename [filename.dcm -> TFE_T1.nii]: Y,N = Y
-r Reorient image to nearest orthogonal: Y,N 
-s SPM2/Analyze not SPM5/NIfTI [ignored if '-n y']: Y,N = N
-t Text report (patient and scan details): Y,N = N
-v Convert every image in the directory: Y,N = Y
-x Reorient and crop 3D NIfTI images: Y,N = N
  You can also set defaults by editing /user/[username]/.dcm2nii/dcm2nii.ini
EXAMPLE: dcm2nii -a y /Users/Joe/Documents/dcm/IM_0116
$ 

To run any of the other binaries they require multiple libraries, not all of which are available:

$ module load gcccore/11.2.0 x11/20210802 gdk-pixbuf/2.42.6 pango/1.48.8 cairo/1.16.0
$ export LD_LIBRARY_PATH=${EBROOTX11}/lib:${EBROOTGDKMINPIXBUF}/lib:${EBROOTPANGO}/lib:${EBROOTCAIRO}/lib
$ lddtree ./dcm2niigui | grep "not found"
    libgtk-x11-2.0.so.0 => not found
    libgdk-x11-2.0.so.0 => not found
    libatk-1.0.so.0 => not found
$ lddtree ./mricron | grep "not found"
    libgtk-x11-2.0.so.0 => not found
    libgdk-x11-2.0.so.0 => not found
    libatk-1.0.so.0 => not found
$ lddtree ./npm | grep "not found"
    libgtk-x11-2.0.so.0 => not found
    libgdk-x11-2.0.so.0 => not found
    libatk-1.0.so.0 => not found
$ 

If you need any of these three apps (which are GUI apps insofar as I can tell) I will have to build several libraries including ATK-2.36.0-GCCcore-11.2.0.eb [and best I can tell] GTK2-2.24.33-GCCcore-11.3.0.eb # modified for GCCcore 11.2.0 and GDK, for which there is no EasyConfig file (maybe the library is part of GTK2 if you are lucky)

pelangho14 commented 3 months ago

Hi Tony, When you mention that I need to use this link to download the dcm2nii-https://www.nitrc.org/frs/?group_id=152. Do I have to open web browser inside the server and install it?

Thanks, Praveena


From: Tony Kew @.> Sent: 18 June 2024 14:08 To: ubccr/software-layer @.> Cc: Praveena Elanghovan @.>; Author @.> Subject: Re: [ubccr/software-layer] dcm2nii (Issue #326)

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Dear Praveena, There is no EasyConfig file for "dcm2nii" (the MRIcron-1.0.20180614.eb EasyConfig is a binary download of MRIcron with dcm2niix)

"dcm2nii" is only available as a binary tarball download The file is "lx.zip" under the "MRIcron/NPM/dcm2nii 2MAY2016" section of this page: https://www.nitrc.org/frs/?group_id=152

You will have to accept the license to download:

Copyright (c) 2016, Chris Rorden All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Since this is a binary only distribution it may well not run at the Center.

"dcm2nii" itself has no external library dependencies, so this might work, as long as it doesn't use the other binaries: dcm2niigui, mricron and npm

$ lddtree ./dcm2nii dcm2nii => ./dcm2nii (interpreter => none) $ $ ./dcm2nii Chris Rorden's dcm2nii :: 2MAY2016 64bit BSD License :: (upgrade to dcm2niix suggested) Either drag and drop or specify command line options: dcm2nii OPTIONS: -4 Create 4D volumes, else DTI/fMRI saved as many 3D volumes: Y,N = Y -3 Create planar RGB images: Y,N = N -a Anonymize [remove identifying information]: Y,N = Y -b Load settings from specified inifile, e.g. '-b C:\set\t1.ini' -c Collapse input folders: Y,N = Y -d Date in filename [filename.dcm -> 20061230122032.nii]: Y,N = Y -e Events (series/acq) in filename [filename.dcm -> s002a003.nii]: Y,N = Y -f Source filename [e.g. filename.par -> filename.nii]: Y,N = N -g Gzip output, filename.nii.gz [ignored if '-n n']: Y,N = Y -i ID in filename [filename.dcm -> johndoe.nii]: Y,N = N -k sKip initial n volumes in fMRI, e.g. '-k 2': = 0 -l pLanar RGB (Y=old Analyze; N=new VTK NIfTI): Y,N = N -m Manually prompt user to specify output format [NIfTI input only]: Y,N = Y -n Output .nii file [if no, create .hdr/.img pair]: Y,N = Y -o Output Directory, e.g. 'C:\TEMP' (if unspecified, source directory is used) -p Protocol in filename [filename.dcm -> TFE_T1.nii]: Y,N = Y -r Reorient image to nearest orthogonal: Y,N -s SPM2/Analyze not SPM5/NIfTI [ignored if '-n y']: Y,N = N -t Text report (patient and scan details): Y,N = N -v Convert every image in the directory: Y,N = Y -x Reorient and crop 3D NIfTI images: Y,N = N You can also set defaults by editing /user/tonykew/.dcm2nii/dcm2nii.ini EXAMPLE: dcm2nii -a y /Users/Joe/Documents/dcm/IM_0116 $

To run any of the other binaries they require multiple libraries, not all of which are available:

$ module load gcccore/11.2.0 x11/20210802 gdk-pixbuf/2.42.6 pango/1.48.8 cairo/1.16.0 $ export LD_LIBRARY_PATH=${EBROOTX11}/lib:${EBROOTGDKMINPIXBUF}/lib:${EBROOTPANGO}/lib:${EBROOTCAIRO}/lib $ lddtree ./dcm2niigui | grep "not found" libgtk-x11-2.0.so.0 => not found libgdk-x11-2.0.so.0 => not found libatk-1.0.so.0 => not found $ lddtree ./mricron | grep "not found" libgtk-x11-2.0.so.0 => not found libgdk-x11-2.0.so.0 => not found libatk-1.0.so.0 => not found $ lddtree ./npm | grep "not found" libgtk-x11-2.0.so.0 => not found libgdk-x11-2.0.so.0 => not found libatk-1.0.so.0 => not found $

If you need any of these three apps (which are GUI apps insofar as I can tell) I will have to build several libraries including ATK-2.36.0-GCCcore-11.2.0.eb [and best I can tell] GTK2-2.24.33-GCCcore-11.3.0.eb # modified for GCCcore 11.2.0 and GDK, for which there is no EasyConfig file (maybe the library is part of GTK2 if you are lucky)

— Reply to this email directly, view it on GitHubhttps://github.com/ubccr/software-layer/issues/326#issuecomment-2176976672, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJACC3724Q2GSI4ZLI6NPYDZICOVBAVCNFSM6AAAAABI5JQM62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWHE3TMNRXGI. You are receiving this because you authored the thread.Message ID: @.***>