questions > converting Philips xml/REC to NIFTI
Showing 1-12 of 12 posts
Display:
Results per page:
May 23, 2018  12:05 PM | Julien Besle - American University of Beirut
converting Philips xml/REC to NIFTI
Hi,

I'm, trying to convert Philips xml/REC images to NIFTI format, but either nothing happens (.REC) or I get an error (.xml):

This is what I've tried:

$ dcm2niix image.REC
Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20171215 (OpenJPEG build) GCC5.3.1 (64-bit Linux)
$ dcm2niix image.xml
Compression will be faster with 'pigz' installed
Chris Rorden's dcm2niiX version v1.0.20171215 (OpenJPEG build) GCC5.3.1 (64-bit Linux)
Error: Unable to find any DICOM images in /mnt/f/data/Scanner/AUBMC_test1/RECxml

I know that converting PAR/REC is supposed to work, but I can't find anything about converting from xml/REC, which is the only format available on the scanner I use (apart from DICOM, but these particular images were exported to REC/xml only).

Is there an option I need to use?
Thanks in advance

Julien
May 23, 2018  01:05 PM | Chris Rorden
RE: converting Philips xml/REC to NIFTI
My software does not support xml/REC. Philips has deprecated the PAR/REC, but now provides researchers with a direct NIfTI conversion as well as well-specified DICOM files. My software will handle Philips DICOM, but I do not have the time to add support for xml/REC. As far as I know, none of the popular PAR/REC->NIfTI converts (dicm2nii, R2A_GUI, dcm2niix, etc) have supported the xml/REC format. I think your options are 1.) search the web for a tool that supports xml/REC (and if you find one, tell me), 2.) use Philips DICOM or direct NIfTI instead of xml/REC, 3.) Make your own xml/REC converter (you could start with a open source PAR/REC converter like dcm2niix and dicm2nii and share your results with the community with a pull request). A promising avenue might be to contact Alexander Leemans who has developed exploreDTI - I believe his project is closed source, but it is matlab based, and if he is willing to share his xml/REC parser you could bolt that onto dicm2nii without too much effort.
May 25, 2018  10:05 AM | Julien Besle - American University of Beirut
RE: converting Philips xml/REC to NIFTI
Hi Chris. Thanks for your quick reply.

The scanner I used does not seem to have export options other than xml/REC and DICOM (no NIFTI), and somehow, the DICOM export option is broken (temporarily hopefully).
I will check again at exporting directly to NIFTI format, and if this doesn't work, I will look into your suggestions and let you know if any converter comes out of it.
Thanks a lot.

Julien
May 25, 2018  03:05 PM | Matthew Clemence - Philips Heathcare Clinical Science
RE: converting Philips xml/REC to NIFTI
Hi,

Just for clarity - DICOM (classic and enhanced) and XMLREC are supported in the base product, NIFTI forms part of a Neuroscience commercial option from release 5 onwards. PAR-REC requires a research agreement to obtain.

For the two formats XMLREC and PARREC, the "rec" part is identical but instead of a plain text file of the "par" format, the same information is now available as an XML file. This descision has been taken to allow the information to be more easily extended as the PAR file was getting increasingly limited.

I am not aware of a XML to PAR converter but standard easy to use librarys for XML exist (such as libXML2 and matlabs XML reader works).

Matthew
May 30, 2018  08:05 AM | Julien Besle - American University of Beirut
RE: converting Philips xml/REC to NIFTI
Thanks Matthew for your clarification.

I've started writing an xml to PAR converter in Matlab (using xmlread).
Are the specifications for the different versions of the PAR file freely available?

(Chris, I have tried exploreDTI, which has a pulgin to convert xml/REC to NIFTI, but this didn't work and I haven't got a response from Alexander Leemans, but haven't got a response yet)

Thanks

Julien
May 30, 2018  09:05 AM | Julien Besle - American University of Beirut
RE: converting Philips xml/REC to NIFTI
Originally posted by Julien Besle:
Are the specifications for the different versions of the PAR file freely available?

I meant "the different versions of the PAR format"
May 30, 2018  12:05 PM | Chris Rorden
RE: converting Philips xml/REC to NIFTI
Matthew can tell you if there is formal documentation for the PAR/REC format. The PAR header is pretty self-documenting, so if you can find a PAR file, you can usually see how that format works. The dcm2niix wiki provides several samples of PAR/REC (check the Archival, DTI and PAR?REC sections).

ince you are explore the Matlab approach, I strongly suggest you fork the dicm2nii code - this provides robust support for PAR/REC format, requires no proprietary toolboxes, provides well designed NIfTI writing and is concise. Adding an xml/REC module to this project would help the community, and you would be starting with a strong foundation. Once you are happy that your fork works well, you can generate a pull request to have your features merged with the main branch.
May 30, 2018  12:05 PM | Julien Besle - American University of Beirut
RE: converting Philips xml/REC to NIFTI
Thanks Chris. I didn't realize that dcm2niix was written in matlab.
I will check it out and try to integrate my converter (I'm getting close).

There are some differences between the information provided in the xml and the information provided in the PAR, which is why it would be helpful to see the format specification of the PAR.
I found someone who can send me PAR and xml files from the same data, so this should help.
May 30, 2018  01:05 PM | Chris Rorden
RE: converting Philips xml/REC to NIFTI
To clarify, dcm2niix is written in C, but Xiangrui Li's dicm2nii is written in Matlab. We often share solutions, so a few of the function/variables and algorithms are similar. However, Xiangrui's project really shows the clarity of Matlab code relative to what one is required to do with a lower-level language like C.
May 30, 2018  03:05 PM | Julien Besle - American University of Beirut
RE: converting Philips xml/REC to NIFTI
Originally posted by Chris Rorden:
To clarify, dcm2niix is written in C, but Xiangrui Li's dicm2nii is written in Matlab. We often share solutions, so a few of the function/variables and algorithms are similar. However, Xiangrui's project really shows the clarity of Matlab code relative to what one is required to do with a lower-level language like C.

I see. (I thought dicm2nii was a typo!)

I have a first version of my xml2par.m converter and I just tried dcm2niix on it and I get the following error message:
Chris Rorden's dcm2niiX version v1.0.20171215 (OpenJPEG build) GCC5.3.1 (64-bit Linux)
This software is unable to convert ancient PAR files: please use legacy dcm2nii

Any idea what part of the PAR file is causing dcm2niix to think that it is ancient?
Thanks

Julien
Jan 13, 2022  08:01 PM | Yimei Cao
RE: converting Philips xml/REC to NIFTI
Originally posted by Julien Besle:
Thanks Matthew for your clarification.

I've started writing an xml to PAR converter in Matlab (using xmlread).
Are the specifications for the different versions of the PAR file freely available?

(Chris, I have tried exploreDTI, which has a pulgin to convert xml/REC to NIFTI, but this didn't work and I haven't got a response from Alexander Leemans, but haven't got a response yet)

Thanks

Julien

Hi Julien,

My name is Yimei Cao and I recently ran into the same problem as you did. I also want to convert .xml file into .par (or .img, which is better) on a MATLAB basis, so I wonder if you successfully converted xml to par using xmlread function? I am new to this field and do not quite understand what an xml file stands for. I would appreciate it so much if you could reply.

Thanks,
Yimei
Jan 13, 2022  08:01 PM | Chris Rorden
RE: converting Philips xml/REC to NIFTI
For a Matlab implementation, look at xml2par.m in dicm2nii:

 https://github.com/xiangruili/dicm2nii