Rank: 686 based on 167 downloads (last 30 days) and 1 file submitted
photo

Xiangrui Li

E-mail
Company/University
The Ohio State University

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Xiangrui
Updated   File Tags Downloads
(last 30 days)
Comments Rating
24 Sep 2014 Screenshot DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li dicom, nifti, siemens, mri, ge, philips 167 13
  • 5.0
5.0 | 1 rating
Comments and Ratings by Xiangrui View all
Updated File Comments Rating
24 Sep 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li

Dear Macro,
Thank you for the error report, and for sending me the file for diagnose.

The problem is caused by some 3rd party dicom converter, which loses the VR info for vendor-specific tags (private tags) during the conversion. Without correct VR, these tags are not correctly interpreted by dicm2nii.

I guess the problem reported by JuanesA89 is likely the same cause.

We now know that GDCM and DicomVCL.com converters, at least some versions of these converters, may cause this problem.

So the suggested solution is to use original dicom data from scanner without other conversion.

-Xiangrui

27 Jan 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li

Hi Paul,
Thank you for the comments and suggestions.

Now the missing file check is not as strict as before. For Philips data, this check is skipped due to the possible sparse instance numbering. For other vendors, missing files at beginning is allowed now.

The bug in save_dti_para is fixed.

The converter can deal with dicom files without meta info now.

Cheers.

-Xiangrui

21 Nov 2013 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li

Hi JuanesA89,
The error means number of slices extracted by the code is not a single number, which is odd. If you don't mind, you can send me one of your dicom files, or dicom header of a file returned by hdr = dicm_hdr(dicmFileName).

-Xiangrui

15 Nov 2013 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li

Hi Qingyan,
I just did an update last night, and it may be available sometime today. I believe it should get bval/bvec from your PAR file. If no, please let me know.
-Xiangrui

02 Oct 2013 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li

Hi O.A,
Thank you for the feedback. I realize it is because fullfile in older Matlab doesn't support cellstr input. Now I use strcat to fix the issue. Please wait for the next update to be available.

Also I tested only V4 of PAR file. In case of PAR file parsing problem, please send me a PAR file if yours is not V4.

-Xiangrui

Comments and Ratings on Xiangrui's Files View all
Updated File Comment by Comments Rating
24 Sep 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li Li, Xiangrui

Dear Macro,
Thank you for the error report, and for sending me the file for diagnose.

The problem is caused by some 3rd party dicom converter, which loses the VR info for vendor-specific tags (private tags) during the conversion. Without correct VR, these tags are not correctly interpreted by dicm2nii.

I guess the problem reported by JuanesA89 is likely the same cause.

We now know that GDCM and DicomVCL.com converters, at least some versions of these converters, may cause this problem.

So the suggested solution is to use original dicom data from scanner without other conversion.

-Xiangrui

23 Sep 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li Rotonda, Marco

Hi Xiangrui,
I'm trying to load some dicom files with dicm2nii.
With general gui I have this error (I'm copying all the command window):

dicm2nii
Xiangrui Li's dicm2nii (feedback to xiangrui.li@gmail.com)
Validating 20 files (GE) ...
Converting 1 series into .nii.gz: subject R A
Cor_T2_FRFSE 20

In an assignment A(I) = B, the number of elements in B and I must be the same.

Error in dicm2nii (line 625)
for j = 1:dim(3), t(j) = tryGetField(h{i}{j}, flds{ind}, nan); end

Error in dicm2nii>dicm2nii_gui (line 1688)
dicm2nii(src, dst, rstFmt, mocoOpt, subjName);

Error in dicm2nii (line 224)
dicm2nii_gui(dataFolder); % mis-use first two input for GUI


Error while evaluating uicontrol Callback

This is what I have if I give a more specific instruction:
dicm2nii('/Users/blond/Documents/NIC/AR/SER006', '/Users/blond/Documents/NIC/AR/SER006/corrected',1,1);
Xiangrui Li's dicm2nii (feedback to xiangrui.li@gmail.com)
Validating 24 files (GE) ...
Converting 1 series into .nii.gz: subject R A
Cor_T2_FRFSE 20
625 for j = 1:dim(3), t(j) = tryGetField(h{i}{j}, flds{ind}, nan); end

In an assignment A(I) = B, the number of elements in B and I must be the same.

Error in dicm2nii (line 625)
for j = 1:dim(3), t(j) = tryGetField(h{i}{j}, flds{ind}, nan); end

Any idea?

Thanks in advance.

Marco

31 May 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li peter888

the dicm2nii tool is very useful...
thanks Dr Xiangrui Li.

27 Jan 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li Li, Xiangrui

Hi Paul,
Thank you for the comments and suggestions.

Now the missing file check is not as strict as before. For Philips data, this check is skipped due to the possible sparse instance numbering. For other vendors, missing files at beginning is allowed now.

The bug in save_dti_para is fixed.

The converter can deal with dicom files without meta info now.

Cheers.

-Xiangrui

19 Jan 2014 DICOM to NIfTI converter dicm2nii.m converts dicom files into nifti files. Author: Xiangrui Li Groot, Paul

Hi Xiangrui,

Nice work! I just converted a bunch of PAR/RECs and a single DICOM series containing Philips DTI data. All PAR/RECs seem to be OK, so that's really nice. However, I had to change a few lines to get it working for the DICOM files.

One issue has to do with the instance numbering of the DICOMs. Our DTI series have sparse instance numbering. So, instead of skipping the series at the line where it prints a line about a missing instance file, I inserted the following:

H = h{i}; % cell array containing empty elements
h{i} = H(~ind); % only keep the non-empty ones

The second thing I had to modify, was the Manufacturer test in function save_dti_para. It seems that structure s initially contains a rather complete DICOM header, but when the for-loops continues, the structure is replaced by a reduced DICOM header that doesn't contain the Manufacturer string anymore. The solution is to store the manufacturer string in a separate variable, or to keep a separate copy of the initial structure s.

I also noticed that the DICOM reading part is very strict when it comes to PART10 compatibility. If the meta header is missing, it will report an unsupported file format. Strictly speaking, this is true, but a lot of (older) applications don't store the meta header at all.

Thanks for making these scripts available.
Paul

Contact us