[ITK-users] extract middle slice from dicom files

Dženan Zukić dzenanz at gmail.com
Fri Nov 17 14:25:45 EST 2017


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

On Fri, Nov 17, 2017 at 9:54 AM, Swetha Sharma <swetha.bsharma at gmail.com>
wrote:

> 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
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20171117/e9e5018d/attachment.html>


More information about the Insight-users mailing list