[Mrtrix-discussion] Problem converting DICOMS with mrconvert

Todd Jolly todd.jolly at uon.edu.au
Sun Jul 17 19:36:46 PDT 2011


Hi Donald,
I am able to convert the DICOM's to nifti format. I was able to get it to work by using the nifti file and specifying the encoding.b gradient file? However, I am not sure if I have the DW scheme correct as I just used the bvecs and bvals without inverting any of the gradient orientation components? Is there a way to tell what reference frame a Siemens Verio scanner uses and which component I have to invert (if any) so that it matches the mrtrix co-ordinate system?
Thanks again
Todd
________________________________
From: Donald Tournier [d.tournier at brain.org.au]
Sent: Thursday, 14 July 2011 3:42 PM
To: Todd Jolly
Cc: mrtrix-discussion at www.nitrc.org
Subject: Re: [Mrtrix-discussion] Problem converting DICOMS with mrconvert

Hi Todd,

Yes, this is pretty strange. I thought I had Siemens mosaic format figured out, but maybe I don't... In any case, there doesn't seem to be any information in the CSA headers about how to handle a case where the mosaic is not a multiple of the acquired matrix. Since you say the other derived images are all 128x128, I have to assume that it must divide out the mosaic evenly into as many chunks as will fit in, but that really is just a guess. I can propose a fix, which is my best guess as to how to handle this case, but it really is just a guess - worth a shot though. If this works, I'm guessing the top or bottom row of the derived images will be padded with zeros - maybe you can check this?

In any case, the fix is to modify a few lines of code in lib/file/dicom/mapper.cpp at line 249 from:

          if (image.dim[0] % image.acq_dim[0] || image.dim[1] % image.acq_dim[1])
            throw Exception ("acquisition matrix [ " + str (image.acq_dim[0]) + " " + str (image.acq_dim[1])
                + " ] does not fit into DICOM mosaic [ " + str (image.dim[0]) + " " + str (image.dim[1])
                + " ] in image \"" + H.name + "\"");

to:

          if (image.dim[0] % image.acq_dim[0] || image.dim[1] % image.acq_dim[1]) {
            error ("WARNING: acquisition matrix [ " + str (image.acq_dim[0]) + " " + str (image.acq_dim[1])
                + " ] does not fit into DICOM mosaic [ " + str (image.dim[0]) + " " + str (image.dim[1])
                + " ] in image \"" + H.name + "\" - adjusting matrix size to suit");
            image.acq_dim[0] = image.dim[0] / guint (float(image.dim[0]) / float(image.acq_dim[0]));
            image.acq_dim[1] = image.dim[1] / guint (float(image.dim[1]) / float(image.acq_dim[1]));
          }

Obviously, you'll need to ./build and install again after the change.
Let us know how that works out...
Cheers,

Donald.


On 14 July 2011 14:55, Todd Jolly <todd.jolly at uon.edu.au<mailto:todd.jolly at uon.edu.au>> wrote:
Hi Donald,
Yes we are using a Siemens Verio 3T. After running 'read_dicom -all -csa' it does show that the acquisition matrix is 127p*128... However it does also say that there are 1024 rows x 1024 columns?
Further, if I open up the header on all of the other diffusion DICOM's (e.g. ADC, EXP, FA etc) the acquisition matrix is 128x128?

I have attached the information from the header after running 'read_dicom'.
Many thanks
Todd
________________________________
From: Donald Tournier [d.tournier at brain.org.au<mailto:d.tournier at brain.org.au>]
Sent: Thursday, 14 July 2011 11:04 AM
To: Todd Jolly
Cc: mrtrix-discussion at www.nitrc.org<mailto:mrtrix-discussion at www.nitrc.org>
Subject: Re: [Mrtrix-discussion] Problem converting DICOMS with mrconvert

Hi Todd,

That's an odd problem, I've never come across that before. Not sure where the problem is, but maybe we can figure it out with a bit more info. Judging from the sequence names, this is using the Siemens product sequence? Can you confirm that the acquisition matrix was indeed 128x127 on the scanner? Sounds like an odd (as in strange :) number to me. One other thing you could do is run 'read_dicom -all -csa FILE' on an individual DICOM file from the relevant series. I appreciate this not always easy to do, since the DICOM standard pretty much states that filenames should be meaningless... If you're struggling with that, this little command might help:

$ find /home/todd/CF002dicom/ -type f -print -exec dicom_filename -q {} \;

This will print the name of every file in the folder hierarchy, followed by a more readily interpreted filename suggestion if it is DICOM. That should allow you find at least one relevant file to run 'read_dicom' on, and post the results (make sure you remove all patient-specific information first though).

Cheers,

Donald.



On 13 July 2011 16:26, Todd Jolly <todd.jolly at uon.edu.au<mailto:todd.jolly at uon.edu.au>> wrote:
Hi all,
I have been having trouble converting my DICOM files to .mif format using mrconvert. Once the DICOM series has been read, an error comes up saying that the acquisition matrix [ 128 127 ] does not fit into the DICOM mosaic. I was wondering if anyone else has come across this problem and if there is a way around it? The error is shown below.
Thank you in advance
Todd

todd-Precision-T1500:~> mrconvert /home/todd/CF002dicom/ dwi.mif
mrconvert: scanning DICOM folder "/home/todd/CF002dicom/"  - ok
Select series ('q' to abort):
   0 -    3 MR images 10:25:25 localizer (fl2d1) [1]
   1 -  176 MR images 10:29:54 T1_Sag_iso_ASRB (tfl3d1_ns) [2]
   2 -   65 MR images 10:46:33 ep2d_diff_mddw_55 slice_64 directions (ep_b3000#34) [11]
   3 -   55 MR images 10:58:21 ep2d_diff_mddw_55 slice_64 directions_ADC (ep_b0_3000) [12]
   4 -   55 MR images 10:58:22 ep2d_diff_mddw_55 slice_64 directions_TRACEW (ep_b3000t) [13]
   5 -   55 MR images 10:58:22 ep2d_diff_mddw_55 slice_64 directions_EXP (ep_b3000) [14]
   6 -   55 MR images 10:58:22 ep2d_diff_mddw_55 slice_64 directions_FA (ep_b0_3000) [15]
   7 -   55 MR images 10:58:22 ep2d_diff_mddw_55 slice_64 directions_ColFA (?) [16]
? 2
mrconvert: reading DICOM series "ep2d_diff_mddw_55 slice_64 directions"... 100%
mrconvert: acquisition matrix [ 128 127 ] does not fit into DICOM mosaic [ 1024 1024 ] in image "CF002 (CF002) [MR] ep2d_diff_mddw_55 slice_64 directions"
mrconvert: error opening image "/home/todd/CF002dicom/"


_______________________________________________
Mrtrix-discussion mailing list
Mrtrix-discussion at www.nitrc.org<mailto:Mrtrix-discussion at www.nitrc.org>
http://www.nitrc.org/mailman/listinfo/mrtrix-discussion




--
Jacques-Donald Tournier (PhD)
Brain Research Institute, Melbourne, Australia
Tel: +61 (0)3 9035 7033



--
Jacques-Donald Tournier (PhD)
Brain Research Institute, Melbourne, Australia
Tel: +61 (0)3 9035 7033
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20110718/3ede8b89/attachment.html


More information about the Mrtrix-discussion mailing list