Discussion:
[ITK-users] extract middle slice from dicom files
Swetha Sharma
2017-11-17 14:54:29 UTC
Permalink
Hi ,

I want to know how to get the image values from middle slice of dicom
series.
-swetha
Dženan Zukić
2017-11-17 19:25:45 UTC
Permalink
Hi Swetha,

the simplest, but not computationally most efficient, is to load
<https://itk.org/ITKExamples/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/Documentation.html>
the series as a 3D image and then access the middle slice:

image3d=reader->GetOutput();
ImageType::IndexType ind=image3d->GetBufferedRegion().GetIndex();
ind[2]=image3d->GetBufferedRegion().GetSize()[2]/2; //middle
slicePixel00=image3d->GetPixel(ind);

Less computation, but more code would be to examine spatial position of
each slice in seriesUID and then just load the one closest to the middle.

We are in the process of switching to discourse <https://discourse.itk.org/>,
please post follow-up questions there.

Regards,
DÅŸenan
Post by Swetha Sharma
Hi ,
I want to know how to get the image values from middle slice of dicom
series.
-swetha
The ITK community is transitioning from this mailing list to
discourse.itk.org. Please join us there!
________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
Loading...