questions > dcm2niix for Philips PAR/REC files
Showing 1-13 of 13 posts
Display:
Results per page:
Jan 26, 2015  07:01 AM | Nina Reislev - Danish Research Centre for Magnetic Resonance
dcm2niix for Philips PAR/REC files
Dear Chris Rorden,

We have installed the newest version of the conversion software dcm2nii - which is now called dcm2niix, right?
I would like to use it to convert Philips PAR/REC diffusion-weighted MRI files into nifti-files (Images and gradient directions, b-values).
When using dcm2niix with the input-directory specified with the PAR/REC files, I get the error: Unable to find any DICOM images.
It seems the software is unable to detect and convert PAR/REC files?
I use previous versions of dcm2nii with PAR/REC without problems.

Best Regards, Nina Reislev
Jan 26, 2015  12:01 PM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
Nina-
  Yes, the latest version of my software is dcm2niix. You can always get the latest stable version by downloading MRIcroGL, or if you are feeling brave you can compile the latest beta release from Github (https://github.com/neurolabusc/dcm2niix).
 The software will convert PAR/REC files just fine. You have three options (I tested this on OS X)
   1.) With MRIcroGL, select Import/ConvertDicomToNifti, then drag and drop your PAR file onto the new dcm2nii window.
   2.) With MRIcroGL, select Import/ConvertDicomToNifti. The dcm2nii window appears. This dcm2nii has an associated menu - select the menu item File/Par/RecToNifti - select the PAR file you wish to convert using the file selection dialog box.
  3.) You can also call dcm2niix from the command line, for example "./dcm2niix ~/Desktop/a.PAR"

-chris
Jan 27, 2015  12:01 AM | Nina Reislev - Danish Research Centre for Magnetic Resonance
RE: dcm2niix for Philips PAR/REC files
Thank you, Chris, it works.
I was using the command line, only specifying the directory path or ".REC" - it works when specifying ".PAR" as you write.
For dicom files it suffice specifying the path.
Best Nina.
Jan 27, 2015  06:01 AM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
The next version will allow you to specify either the .PAR (header data) or .REC (image data). As you note, for PAR/REC you specify each file (since they explicitly code a complete volume) rather than a folder (for DICOM a single volume typically spans multiple files).
Dec 6, 2016  09:12 AM | Luigi Antelmi
RE: dcm2niix for Philips PAR/REC files
Dear Chris,

I've just cloned and compiled the source code from https://github.com/rordenlab/dcm2niix

When I try to convert a (T1 3D) PAR (or REC) file it says:

Chris Rorden's dcm2niiX version 25Nov2016 (64-bit Linux)
Done reading PAR header version 4.2, with 1 volumes
Error: unable to load t1.REC
Conversion required 0.027482 seconds.

with no other output. Any suggestion on how to make it work?

Thank you very much!
Luigi.
Dec 6, 2016  10:12 AM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
Luigi.
 This problem was specific to yesterday's development source code. You can either get the latest version or you can get a pre-compiled version from NITRC.
Sep 27, 2018  10:09 AM | Josh Robinson
RE: dcm2niix for Philips PAR/REC files
Hi Chris,

I am having trouble using dcm2niix from the command line and I was hoping you would be able to help. I am trying to convert diffusion weighted PAR/REC files to nifti. I supply the path directly to the .par file, however it returns the error "Error: output folder invalid: /path/to/par/file" when I do not have the  -o option set. Alternatively, I give the path to the folder containing the par files, but it gives an error saying there are no dicom files in the specified folder. My (paraphrased) command is here:

/path/to/executable -f outname /path/to/par/file

When I use the GUI, it works just fine, but given the volume of data I need to convert, using the command line utility would be much more convenient, and given the simplicity of the command I don't see any error in my syntax. Would you have any ideas as to what may be going on here? Any guidance is greatly appreciated.

Thank you,

Josh Robinson
Sep 27, 2018  12:09 PM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
I can not replicate your issue. All of these commands work for me

./dcm2niix -f outname -o ~/tst/parx ~/tst/parx/b.PAR
./dcm2niix -o ~/tst/parx ~/tst/parx/
./dcm2niix ~/tst/parx/b.
./dcm2niix ~/tst/parx/
  • You may want to check that you are using a recent version, when I ran my copy I got Chris Rorden's dcm2niiX version v1.0.20180918 GCC6.1.0 (64-bit MacOS)
  • If any of your paths have spaces in them, make sure to wrap the argument in quotes.
  • Make sure you have the PAR and REC file in the same folder.
Nov 28, 2018  01:11 AM | josephine g
RE: dcm2niix for Philips PAR/REC files
Hi Chis,

I tried to use dcm2niix to convert PAR/REC images into nifti format, but can't seem to make it work.
Can you help me identify what I'm doing wrong?

command: dcm2niix $datadir/filename.PAR.gz -o $outdir
output:
Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20180622 GCC4.8.2 (64-bit Linux)
Error: Unable to find any DICOM images in /$datadir (or subfolders 5 deep)

The PAR and REC files are in the same folder.

Thanks!
Josephine
Nov 28, 2018  03:11 AM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
Josephine -
  The name of the file you want to convert is always the LAST parameter provided. The rationale for this is that it supports operating systems where you drag and drop the file you want to convert onto the application. Therefore, your command should be
  dcm2niix -o $outdir $datadir/filename.PAR.gz
run dcm2niix with no parameters 
  dcm2niix
to get more help on proper usage. I would also recommend updating to the latest version.

-chrs
Dec 3, 2018  05:12 AM | josephine g
RE: dcm2niix for Philips PAR/REC files
Hi Chris,

Thanks for your pointers. I upgraded to the newest dcm2niix version and changed the command, but got the same error that the package is unable to detect any images. However, it seemed to locate the PAR files after uncompressing them (filename.PAR.gz > filename.PAR). 
However, it now returns a different error related to the number of slices:

path/to/new_version/dcm2niix -o /$outdir /$imgdir/filename.PAR

Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20181125 GCC4.8.2 (64-bit Linux)
Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
Found 18950 slices, but expected divisible by 18962: slices*grad*bval*cardiac*echo*dynamic*mix*labels = 38*1*1*1*1*499*1*1
/$imgdir
Error: Total number of slices (18950) not divisible by slices per 3D volume (38) [acquisition aborted]. Try dicm2nii or R2AGUI: 
/$imgdir


It also reported an error related to the number of dynamics, which was inconsistent with the header info. This warning disappeared after manually changing the header (PAR file). 

Can you give any advise on how to deal with the error above?
Thanks!

Best,
Josephine
Dec 3, 2018  06:12 AM | Chris Rorden
RE: dcm2niix for Philips PAR/REC files
Looks like this was an incomplete acquisition, where the scanner was interrupted in the middle of acquiring a volume. I would follow the advice provided by dcm2niix and use dicm2nii.
Dec 3, 2018  08:12 AM | josephine g
RE: dcm2niix for Philips PAR/REC files
Thanks for your fast reply. This was a complete acquisition and the problem occurs with other subjects as well, which makes me believe there is an issue with inconsistent header info. I will try dicm2nii.
Thanks!