questions > error converting PAR/REC to nii - fewer slices found than expected
Showing 1-5 of 5 posts
Display:
Results per page:
Jan 11, 2019  04:01 PM | Ben Conrad
error converting PAR/REC to nii - fewer slices found than expected
Hello,
I am attempting to convert some PAR/REC images to nifti. I had been doing this (1+ years ago) with dicm2nii.m matlab package on the same files (mostly successfully except there was a flipped dimension). But after upgrading to most recent version of the matlab package, these files will not convert. I am now trying to do this with dcm2niix, which provides a bit more explicit error message. Here is the error I receive:
conrabn1@conrabn1-VirtualBox:~$ ./dcm2niix /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
Chris Rorden's dcm2niiX version v1.0.20181125 (JP2:OpenJPEG) (JP-LS:CharLS) GCC5.5.0 (64-bit Linux)
Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
Error: Unknown type 4: not magnitude[0], real[1], imaginary[2] or phase[3].
Error: Catastrophic error: found 480 but expected 720 slices. /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
slices*grad*bval*cardiac*echo*dynamic*mix*labels = 240*1*1*1*1*1*1*1
Warning: Intensity slope/intercept varies between slices! [check resulting images]
Done reading PAR header version 4.2, with 720 slices

And just for reference, here is error message in matlab from dicm2nii.m, running on same data: 
Validating 1 files ...
Inconsistent image size, bits etc: /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR.
No valid files found:
Inconsistent image size, bits etc: /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
.

Any help would be greatly appreciated, thank you!

-Ben
Jan 11, 2019  06:01 PM | Chris Rorden
RE: error converting PAR/REC to nii - fewer slices found than expected
Ben, 
 I am afraid that neither I nor Xiangrui Li (who develops dicm2nii) have access to Philips hardware. Further, the Philips PAR/REC is proprietary and we do not have a formal documentation (and the implementation has changed a bit over the years). The main issue seems to be that your PAR file describes the "image_type_mr" as being "4" and I have no idea what that means. Most MRI scans only store the magnitude image (type 0). However, field maps often store the the magnitude and phase (3) images or the real (1) and imaginary (2) images (which you would use as the input for Fugue).I note this is a "Work In Progress" so perhaps you can look at the image on the console to determine what type of image this is. In general I prefer my software to exit with an error than generate a bogus dataset. I think you have a few options:
 1. Can you export the data as DICOM? That should give a nice result, and will provide better archival data than a proprietary fromat.
 2. You could patch dcm2niix to handle these (and issue a pull request to share your solution). 
 3. You could edit the PAR file with a text editor to fix the problem directly
 4. You could send me a sample and I will see if there is a solution.
Jan 11, 2019  09:01 PM | Ben Conrad
RE: error converting PAR/REC to nii - fewer slices found than expected
Hi Chris, 
Really appreciate the support. Unfortunately, a significant number of these data were stored in our PACs only as PAR/REC, as part of "SuperExport" compressed folders. Other subjects did have this scan make it as DICOM, and our dicm2niix handles those well. I am happy to look into a solution, editing the PAR seems straightforward enough. Went ahead and sent you some examples.  Thanks again! 

-Ben
Jan 12, 2019  06:01 AM | Chris Rorden
RE: error converting PAR/REC to nii - fewer slices found than expected
Thanks for the sample. Issue generated on Github.
Mar 8, 2019  08:03 AM | Josh Robinson
RE: error converting PAR/REC to nii - fewer slices found than expected
Hello,

I have an issue similar to this one below. I'm trying to convert PAR/REC diffusion files, but for some of them, I get the following error message:

Error: Catastrophic error: found 2310 but expected 2380 slices.

Checking the PAR header files and RECs don't reveal any obvious problems - there are 2380 slices reported in the PAR and there are 2380 slices in the REC file. I don't get any error regarding the image type, which is what the patch explained on github relates to, if I'm not mistaken. I have looked at headers of subjects who convert successfully and haven't revealed any causes as far as I can tell. One volume in the REC file is an ADC image, which would be my guess as to what is causing it, but that doesn't explain why it handles others with the same acquisition fine. I see that PAR/REC is not too popular here, but any guidance would be very much appreciated.

Thanks,

Josh

Originally posted by Ben Conrad:
Hello,
I am attempting to convert some PAR/REC images to nifti. I had been doing this (1+ years ago) with dicm2nii.m matlab package on the same files (mostly successfully except there was a flipped dimension). But after upgrading to most recent version of the matlab package, these files will not convert. I am now trying to do this with dcm2niix, which provides a bit more explicit error message. Here is the error I receive:
conrabn1@conrabn1-VirtualBox:~$ ./dcm2niix /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
Chris Rorden's dcm2niiX version v1.0.20181125 (JP2:OpenJPEG) (JP-LS:CharLS) GCC5.5.0 (64-bit Linux)
Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
Error: Unknown type 4: not magnitude[0], real[1], imaginary[2] or phase[3].
Error: Catastrophic error: found 480 but expected 720 slices. /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
slices*grad*bval*cardiac*echo*dynamic*mix*labels = 240*1*1*1*1*1*1*1
Warning: Intensity slope/intercept varies between slices! [check resulting images]
Done reading PAR header version 4.2, with 720 slices

And just for reference, here is error message in matlab from dicm2nii.m, running on same data: 
Validating 1 files ...
Inconsistent image size, bits etc: /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR.
No valid files found:
Inconsistent image size, bits etc: /mnt/CR7T_Connectivity/MRI_raw/CR_035_314914/Price_314914_WIP_MP2RAGE_1x1x1_SENSE_5_1.PAR
.

Any help would be greatly appreciated, thank you!

-Ben