[prev in list] [next in list] [prev in thread] [next in thread] 

List:       insight-users
Subject:    Re: [ITK-users] extract middle slice from dicom files
From:       DÅ <dzenanz () gmail ! com>
Date:       2017-11-17 19:25:45
Message-ID: CAPf2UMQqngQS_ACeYr954h34ORw6Woe8sQezYvDy7YEbzRe+Ug () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small">Hi Swetha,</div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">the \
simplest, but not computationally most efficient, is to <a \
href="https://itk.org/ITKExamples/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/Documentation.html" \
target="_blank">load</a> the series as a 3D image and then access the middle \
slice:</div><div class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small"><br></div><div \
class="gmail_default" style="font-size:small"><font face="monospace, \
monospace">image3d=reader-&gt;GetOutput();</font></div><div class="gmail_default" \
style="font-size:small"><font face="monospace, monospace">ImageType::IndexType \
ind=image3d-&gt;<wbr>GetBufferedRegion().GetIndex()<wbr>;</font></div><div \
class="gmail_default" style="font-size:small"><font face="monospace, \
monospace">ind[2]=image3d-&gt;<wbr>GetBufferedRegion().GetSize()[<wbr>2]/2; \
//middle</font></div><div class="gmail_default" style="font-size:small"><font \
face="monospace, monospace">slicePixel00=image3d-&gt;<wbr>GetPixel(ind);</font></div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">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.</div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small"><br></div><div \
class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">We are \
in the process of switching to <a href="https://discourse.itk.org/" \
target="_blank">discourse</a>, please post follow-up questions there.</div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small"><br></div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div \
class="gmail_default" \
style="font-family:verdana,sans-serif;font-size:small">Dženan</div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 17, 2017 at 9:54 AM, \
Swetha Sharma <span dir="ltr">&lt;<a href="mailto:swetha.bsharma@gmail.com" \
target="_blank">swetha.bsharma@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi ,<div><br></div><div>I want to know how to \
get the image values from middle slice of dicom series.</div><span \
class="m_6413608504335508219HOEnZb"><font \
color="#888888"><div>-swetha</div></font></span></div> <br>The ITK community is \
transitioning from this mailing list to <a href="http://discourse.itk.org" \
rel="noreferrer" target="_blank">discourse.itk.org</a>. Please join us there!<br> \
______________________________<wbr>__<br> Powered by <a href="http://www.kitware.com" \
rel="noreferrer" target="_blank">www.kitware.com</a><br> <br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" \
target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br> <br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" \
target="_blank">http://www.kitware.com/product<wbr>s/protraining.php</a><br> <br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" \
target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" \
target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-users</a><br> \
<br></blockquote></div><br></div></div>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic