[Insight-users] why not ITK can read the spacing
Mathieu Malaterre
mathieu.malaterre at kitware.com
Fri Apr 28 13:35:51 EDT 2006
Hi Markus/Yixun,
The computation of the z-spacing/spacing[2] is correct in ITK/GDCM.
Here is what we do, take the image origin (3D world coordinate), take
the image origin of the next image. Compute the normal vector, compute
the norm of this vector, this is exactly what you are looking for: the
spacing along the 'z' direction.
Original explanation of the reason behind can be found in this thread
(very instructive):
http://www.itk.org/pipermail/insight-users/2003-September/004762.html
Now I understand the DICOM standard is pretty big and could be
confusing, and sometime vendor do not respect it. In your case one would
think those two should be identical. Apparently this is not.
As a side note, there are also extreme cases where you have:
// Spacing Between Slices : distance between the middle of 2 slices
// Slices may be :
// jointives (Spacing between Slices = Slice Thickness)
// overlapping (Spacing between Slices < Slice Thickness)
// disjoints (Spacing between Slices > Slice Thickness)
If you still believe the computation of the z spacing is wrong, then
please send me a couple of slices so that I can examine your data.
HTH
Mathieu
Markus Weigert wrote:
> Hi Luis,
>
> he may be right.
> I also encountered problems when reading certain
> DICOM - MR - files and rendering the volume using the SliceView class.
> Sometimes, the spacing is set to a value of 1.0 in z - direction,
> although this is apparently wrong.
> Using non itk - programms to display the image,
> it is shown in the right way.
>
> Regards,
> Markus
>
>
>
>
> Luis Ibanez wrote:
> <
> <
> <Hi Yixun,
> <
> <What lead you to think that the value of spacing[2] is incorrect ?
> <
> <Are you comparing the value of spacing[2] against the value in
> <the DICOM header ?
> <
> <
> <If so, then it is normal that they differ.
> <
> <The spacing[2] is computed using the difference in
> <origin between consecutive slices. This value does not
> <have to match the spacing value in the DICOM header.
> <
> <
> <
> < Regards,
> <
> <
> < Luis
>
>
>
> ------------------------
> Yixun Liu wrote:
> > Hi,
> >
> > I use the below codes to read a series of MRI,
> >
> > this->dicomReader = ReaderType_Short::New();//itk
> > itk::DICOMSeriesFileNames::Pointer nameGenerator =
> > itk::DICOMSeriesFileNames::New();
> > nameGenerator->SetDirectory( (const char*)strPath );
> > typedef std::vector<std::string> fileNamesContainer;
> > fileNamesContainer fileNames;
> > fileNames = nameGenerator->GetFileNames();
> > this->dicomReader->SetImageIO( itk::DICOMImageIO2::New() );
> > this->dicomReader->SetFileNames( fileNames );
> > this->dicomReader->Update();
> >
> > However, the spacing[2], namely spacing between slices, is uncorrect.
> >
> > Hope your help!
> >
> >
> > Regards,
> >
> > Yixun Liu
> >
> >
> > ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list