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

List:       vtkusers
Subject:    Re: [vtkusers] What ditermines whether the slice order should be reversed?
From:       Liu_tj <tjlp () netease ! com>
Date:       2017-08-30 1:44:31
Message-ID: 5db0173b.1b.15e30cfb20c.Coremail.tjlp () netease ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Hi, David,

Thanks. I will try it.

Also thanks for the great vtk-dicom component again.

Liu Peng





在2017-08-30,"David Gobbi" <david.gobbi@gmail.com> 写道: \
-----原始邮件----- 发件人:"David Gobbi" <david.gobbi@gmail.com>
发送时间:2017年08月30日 星期三
收件人:"Liu_tj" <tjlp@netease.com>
抄送:"vtkusers" <vtkusers@vtk.org>
主题:Re: Re: Re: Re: Re: What ditermines whether the slice order should be \
reversed?


On Tue, Aug 29, 2017 at 6:05 PM, Liu_tj <tjlp@netease.com> wrote:
Hi,David,

2 questions come up.

1. If I call reader->SetMemoryRowOrderToFileNative() before update() method, do I \
still need to use vtkDICOMToRAS?



Yes, if you are using vtkImageViewer (or vtkImageViewer2).  If you do not use \
vtkDICOMToRAS, then vtkImageViewer will show the image upside-down.


 
2. If I update to the latest vtk-dicom version, do I still need to use \
reader->SetMemoryRowOrderToFileNative() and vtkDICOMToRAS?


No.  Again, I'm assuming that you are using vtkImageViewer2.


 - David




 
在2017-08-29,"David Gobbi" <david.gobbi@gmail.com> 写道: \
-----原始邮件----- 发件人:"David Gobbi" <david.gobbi@gmail.com>
发送时间:2017年08月29日 星期二
收件人:"Liu_tj" <tjlp@netease.com>
抄送:"vtkusers" <vtkusers@vtk.org>
主题:Re: Re: Re: Re: What ditermines whether the slice order should be reversed?



Hi Liu Peng,


If you apply vtkImageFlip to the image, then the matrix returned by \
reader->GetPatientMatrix() will not work with the image.  I recommend that, at the \
very least, you try doing the following instead:


1) use reader->SetMemoryRowOrderToFileNative(), and
2) try using vtkDICOMToRAS instead of vtkImageFlip:
 https://github.com/dgobbi/vtk-dicom/blob/master/Source/vtkDICOMToRAS.h


Also, if possible, update to the latest version of vtk-dicom.


Cheers,
 - David


On Tue, Aug 29, 2017 at 1:58 AM, Liu_tj <tjlp@netease.com> wrote:
Hi, David,

Actually in my current code I use vtkImageFlip to flip the image data to solve the \
slice display orientation issue on coronal and saggital view as follow:

        vtkDICOMReader* reader = vtkDICOMReader::New();
        reader->SetFileNames(vtkDICOMFilePaths);
        reader->Update();
        vtkImageFlip* flip = vtkImageFlip::New();
        flip->SetInputConnection(reader->GetOutputPort());
        flip->SetFilteredAxis(2);
        flip->Update();
        vtkImageData* imageData = flip->GetOutput();



Thanks
Liu Peng


在2017-08-29,"David Gobbi" <david.gobbi@gmail.com> 写道: \
-----原始邮件----- 发件人:"David Gobbi" <david.gobbi@gmail.com>
发送时间:2017年08月29日 星期二
收件人:"Liu_tj" <tjlp@netease.com>
抄送:"vtkusers" <vtkusers@vtk.org>
主题:Re: Re: Re: What ditermines whether the slice order should be reversed?



Hi Liu Peng,


For vtk-dicom, that would actually be version 0.7.1 (the current version is 0.8.5).


It is possible that you have run into this bug, which was fixed in 0.8.3:
https://github.com/dgobbi/vtk-dicom/issues/132

The work-around for the bug is reader->SetMemoryRowOrderToFileNative().  See here for \
more info: http://dgobbi.github.io/vtk-dicom/doc/api/image_orientation.html


Unfortunately, calling SetMemoryRowOrderToFileNative() doesn't work very well with \
vtkImageViewer or vtkImageViewer2, since these "viewer" classes insist on images that \
are in "bottom-to-top" order (DICOM images are natively in top-to-bottom order).  \
However, if you use vtkImageActor or vtkImageSlice to display your images, then you \
can set the camera so that "up" is in the correct direction.


The vtkDICOMReader uses ImageOrientationPatient (0020,0037) and ImagePositionPatient \
(0020,0032) to put the slices in order.  These attributes are more reliable and more \
precise than PatientPosition (0018,5100).


Cheers,
 - David








On Mon, Aug 28, 2017 at 7:03 PM, Liu_tj <tjlp@netease.com> wrote:
Hi, David,

I forgot to mention the verison. The VTK and vtk-DICOM version are both 7.1


Thanks
Liu Peng


在2017-08-28,"David Gobbi" <david.gobbi@gmail.com> 写道: \
-----原始邮件----- 发件人:"David Gobbi" <david.gobbi@gmail.com>
发送时间:2017年08月28日 星期一
收件人:"Liu_tj" <tjlp@netease.com>
抄送:"vtkusers" <vtkusers@vtk.org>
主题:Re: Re: What ditermines whether the slice order should be reversed?



Hi Liu Peng,


What versions of VTK and vtk-dicom you are using?


 - David  


On Mon, Aug 28, 2017 at 12:31 AM, Liu_tj <tjlp@netease.com> wrote:

Hi, David,



As far as I know, in the RCS system, the direction of Z axis is from foot to head.So \
by default, the slice order in your dicom reader is consistent with the RCS \
system.When the reader sorts the slices, does it consider the Patient Postion \
tag(0080,5100)? Some doctors might use some DICOM tools which the slice order is from \
head to foot and get used to that.

My code block for load slices is as follow:

       vtkStringArray* vtkDICOMFilePaths = vtkStringArray::New();
        vtkDICOMFilePaths->SetNumberOfValues(aDICOMFilePaths->Length);
        for(int i = 0; i < aDICOMFilePaths->Length; i ++)
        {
            String^ filePath = aDICOMFilePaths[i];
            const char* filePathByChars = MDKStringUtility::NStringToChars(filePath);

            vtkDICOMFilePaths->SetValue(i, filePathByChars);
        }

        vtkDICOMReader* reader = vtkDICOMReader::New();
        vtkImageData* imageData = reader->GetOutput();

Thanks
Liu Peng
在2017-08-28,"David Gobbi" <david.gobbi@gmail.com> 写道: \
-----原始邮件----- 发件人:"David Gobbi" <david.gobbi@gmail.com>
发送时间:2017年08月28日 星期一
收件人:"Liu_tj" <tjlp@netease.com>
抄送:"vtkusers" <vtkusers@vtk.org>
主题:Re: What ditermines whether the slice order should be reversed?



Hi Liu Peng,


The vtkDICOMReader sorts according to the Image Plane Module:
http://dicom.nema.org/MEDICAL/dicom/current/output/chtml/part03/sect_C.7.6.2.html
That is, the slices are sorted in a manner such that the VTK image data has a \
right-handed coordinate system (called an RCS in the link above).


Sorting the slices to get an RCS means that sometimes the slices will be sorted the \
same as the InstanceNumber, and sometimes they will be sorted opposite to \
InstanceNumber, depending on the order in which scanner ordered the slices.


You can perform the sorting yourself by calling reader->SortingOff().  If Sorting is \
Off, the reader will take the slices in the same order as the vtkStringArray that you \
passed to reader->SetFileNames().


If you send me the block of code where you set up and call the reader, then I might \
be able to provide more help.  Don't forget to also say what versions of VTK and \
vtk-dicom you are using.


Cheers,
 - David






On Sun, Aug 27, 2017 at 10:41 AM, Liu_tj <tjlp@netease.com> wrote:

Hi,


I have a question about the DICOM slice order. I use the DICOM reader by David Gobbi \
to read the slice series to vtkImageData. And I found that the oder is the same as \
the order by DICOM instanceNumber tag. However, some doctors tell me that the order \
should be reversed because the scan should start from head to foot.



@David, if I need to reverse, how to achieve that by your DICOM reader?


Thanks
Liu Peng









 


[Attachment #5 (text/html)]

Hi, David,<br><br>Thanks. I will try it.<br><br>Also thanks for the great vtk-dicom \
component again.<br><br>Liu Peng<br><div><br><br></div>  <span>
 </span>
<br>	在2017-08-30,"David Gobbi" &lt;david.gobbi@gmail.com&gt; 写道:
	<blockquote id="isReplyContent" style="padding-left:1ex; margin: 0px 0px 0px 0.8ex; \
                BORDER-LEFT: #ccc 1px solid">
	-----原始邮件-----<br>
	<b>发件人:</b>"David Gobbi" &lt;david.gobbi@gmail.com&gt; <br>
	<b>发送时间:</b>2017年08月30日 星期三<br>
	<b>收件人:</b>"Liu_tj" &lt;tjlp@netease.com&gt;<br>
	<b>抄送:</b>"vtkusers" &lt;vtkusers@vtk.org&gt;<br>
	<b>主题:</b>Re: Re: Re: Re: Re: What ditermines whether the slice order should be \
reversed?<br> <br><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On \
Tue, Aug 29, 2017 at 6:05 PM, Liu_tj <span dir="ltr">&lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">Hi,David,<br><br>2 questions come up.<br><br>1. If I \
call reader-&gt;<wbr>SetMemoryRowOrderToFileNative(<wbr>) before update() method, do \
I still need to use vtkDICOMToRAS?<br></wbr></wbr></blockquote><div><br></div><div>Yes, \
if you are using vtkImageViewer (or vtkImageViewer2).&nbsp; If you do not use \
vtkDICOMToRAS, then vtkImageViewer will show the image \
upside-down.</div><div><br></div><div>&nbsp;</div><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2. If I update \
to the latest vtk-dicom version, do I still need to use \
reader-&gt;<wbr>SetMemoryRowOrderToFileNative(<wbr>) and \
vtkDICOMToRAS?</wbr></wbr></blockquote><div><br></div><div>No.&nbsp; Again, I'm \
assuming that you are using vtkImageViewer2.</div><div><br></div><div>&nbsp;- \
David</div><div><br></div><div><br></div><div>&nbsp;</div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><span class="">	在2017-08-29,"David Gobbi" &lt;<a \
href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt; \
写道:  </span><blockquote id="m_5567654153334962732isReplyContent" \
style="padding-left:1ex;margin:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><span \
                class="">
	-----原始邮件-----<br>
	<b>发件人:</b>"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; <br>  \
<b>发送时间:</b>2017年08月29日 星期二<br>  <b>收件人:</b>"Liu_tj" &lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;<br>  \
<b>抄送:</b>"vtkusers" &lt;<a href="mailto:vtkusers@vtk.org" \
target="_blank">vtkusers@vtk.org</a>&gt;<br>  </span><b>主题:</b>Re: Re: Re: Re: \
What ditermines whether the slice order should be reversed?<div><div class="h5"><br> \
<br><div dir="ltr">Hi Liu Peng,<div><br></div><div>If you apply vtkImageFlip to the \
image, then the matrix returned by reader-&gt;GetPatientMatrix() will not work with \
the image.&nbsp; I recommend that, at the very least, you try doing the following \
instead:</div><div><br></div><div>1) use \
reader-&gt;<wbr>SetMemoryRowOrderToFileNative(<wbr>), and</wbr></wbr></div><div>2) \
try using vtkDICOMToRAS instead of vtkImageFlip:</div><div>&nbsp;<a \
href="https://github.com/dgobbi/vtk-dicom/blob/master/Source/vtkDICOMToRAS.h" \
style="white-space:pre-wrap" \
target="_blank">https://github.com/dgobbi/<wbr>vtk-dicom/blob/master/Source/<wbr>vtkDICOMToRAS.h</wbr></wbr></a></div><div><div \
class="gmail_extra"><br></div><div class="gmail_extra">Also, if possible, update to \
the latest version of vtk-dicom.</div><div class="gmail_extra"><br></div><div \
class="gmail_extra">Cheers,</div><div class="gmail_extra">&nbsp;- David</div><div \
class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 29, 2017 at 1:58 AM, \
Liu_tj <span dir="ltr">&lt;<a href="mailto:tjlp@netease.com" \
target="_blank">tjlp@netease.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Hi, David,<br><br>Actually in my current code I \
use vtkImageFlip to flip the image data to solve the slice display orientation issue \
on coronal and saggital view as follow:<span \
class="m_5567654153334962732gmail-"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
vtkDICOMReader* reader = vtkDICOMReader::New();<br></span>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; reader-&gt;SetFileNames(vtkDICOMF<wbr>ilePaths);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; reader-&gt;Update();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
vtkImageFlip* flip = vtkImageFlip::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
flip-&gt;SetInputConnection(reade<wbr>r-&gt;GetOutputPort());<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; flip-&gt;SetFilteredAxis(2);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; flip-&gt;Update();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
vtkImageData* imageData = \
flip-&gt;GetOutput();<br><div><br></div><div>Thanks</div><div>Liu Peng<br></div><span \
class="m_5567654153334962732gmail-">  <span>
 </span>
<br>	在2017-08-29,"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; 写道:  </span><blockquote \
id="m_5567654153334962732gmail-m_815751471093880078isReplyContent" \
style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid \
                rgb(204,204,204)"><span class="m_5567654153334962732gmail-">
	-----原始邮件-----<br>
	<b>发件人:</b>"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; <br>  \
</span><b>发送时间:</b>2017年08月29日 星期二<span \
class="m_5567654153334962732gmail-"><br>  <b>收件人:</b>"Liu_tj" &lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;<br>  \
<b>抄送:</b>"vtkusers" &lt;<a href="mailto:vtkusers@vtk.org" \
target="_blank">vtkusers@vtk.org</a>&gt;<br>  </span><b>主题:</b>Re: Re: Re: What \
ditermines whether the slice order should be reversed?<div><div \
class="m_5567654153334962732gmail-h5"><br> <br><div dir="ltr"><div>Hi Liu \
Peng,</div><div><br></div><div>For vtk-dicom, that would actually be version 0.7.1 \
(the current version is 0.8.5).</div><div><br></div><div>It is possible that you have \
run into this bug, which was fixed in 0.8.3:</div><div><a \
href="https://github.com/dgobbi/vtk-dicom/issues/132" \
target="_blank">https://github.com/dgobbi/vtk-<wbr>dicom/issues/132</wbr></a><br></div><div>The \
work-around for the bug is&nbsp;<span \
style="font-size:12.8px">reader-&gt;SetMemoryRowOrderTo<wbr>FileNative(). \
&nbsp;</wbr></span><span style="font-size:12.8px">See here for more \
info:</span></div><div><span style="font-size:12.8px"><a \
href="http://dgobbi.github.io/vtk-dicom/doc/api/image_orientation.html" \
target="_blank">http://dgobbi.github.io/vtk-di<wbr>com/doc/api/image_orientation.<wbr>html</wbr></wbr></a></span></div><div><span \
style="font-size:12.8px"><br></span></div><div><span \
style="font-size:12.8px">Unfortunately, calling SetMemoryRowOrderToFileNative(<wbr>) \
doesn't work very well with vtkImageViewer or vtkImageViewer2, since these "viewer" \
classes insist on images that are in "bottom-to-top" order (DICOM images are natively \
in top-to-bottom order).&nbsp; However, if you use vtkImageActor or vtkImageSlice to \
display your images, then you can set the camera so that "up" is in the correct \
direction.</wbr></span></div><div><span \
style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">The \
vtkDICOMReader uses&nbsp;</span><span \
style="font-size:12.8px">ImageOrientationPatient (0020,0037) and ImagePositionPatient \
(0020,0032) to put the slices in order.&nbsp; These attributes are more reliable and \
more precise than PatientPosition (0018,5100).</span></div><div><span \
style="font-size:12.8px"><br></span></div><div><span \
style="font-size:12.8px">Cheers,</span></div><div><span \
style="font-size:12.8px">&nbsp;- David</span></div><div><span \
style="font-size:12.8px"><br></span></div><div><span \
style="font-size:12.8px"><br></span></div><br><div class="gmail_extra"><br><div \
class="gmail_quote">On Mon, Aug 28, 2017 at 7:03 PM, Liu_tj <span dir="ltr">&lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, David,<br><br>I \
forgot to mention the verison. The VTK and vtk-DICOM version are both 7.1<span \
class="m_5567654153334962732gmail-m_815751471093880078gmail-"><br><div><br>Thanks</div><div>Liu \
Peng<br></div>  <span>
 </span>
<br>	在2017-08-28,"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; 写道:  </span><blockquote \
id="m_5567654153334962732gmail-m_815751471093880078gmail-m_-1172525414657701273isReplyContent" \
style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204)"><span \
                class="m_5567654153334962732gmail-m_815751471093880078gmail-">
	-----原始邮件-----<br>
	<b>发件人:</b>"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; <br>  \
<b>发送时间:</b>2017年08月28日 星期一<br>  <b>收件人:</b>"Liu_tj" &lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;<br>  \
<b>抄送:</b>"vtkusers" &lt;<a href="mailto:vtkusers@vtk.org" \
target="_blank">vtkusers@vtk.org</a>&gt;<br>  </span><b>主题:</b>Re: Re: What \
ditermines whether the slice order should be reversed?<div><div \
class="m_5567654153334962732gmail-m_815751471093880078gmail-h5"><br> <br><div \
dir="ltr">Hi Liu Peng,<div><br></div><div>W<span style="font-size:12.8px">hat \
versions of VTK and vtk-dicom you are using?</span></div><div><span \
style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">&nbsp;- \
David &nbsp;</span></div><div class="gmail_extra"><br><div class="gmail_quote">On \
Mon, Aug 28, 2017 at 12:31 AM, Liu_tj <span dir="ltr">&lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi, \
David,<br></div><div><br></div>  <span>
 </span>
As far as I know, in the RCS system, the direction of Z axis is from foot to head.So \
by default, the slice order in your dicom reader is consistent with the RCS \
system.When the reader sorts the slices, does it consider the Patient Postion \
tag(0080,5100)? Some doctors might use some DICOM tools which the slice order is from \
head to foot and get used to that.<br><br>My code block for load slices is as \
follow:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkStringArray* vtkDICOMFilePaths \
= vtkStringArray::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
vtkDICOMFilePaths-&gt;SetNumberOf<wbr>Values(aDICOMFilePaths-&gt;Length<wbr>);<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; for(int i = 0; i &lt; aDICOMFilePaths-&gt;Length; i \
++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String^ filePath = \
aDICOMFilePaths[i];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; const \
char* filePathByChars = \
MDKStringUtility::NStringToCha<wbr>rs(filePath);<br><br>&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkDICOMFilePaths-&gt;SetValue(i, \
filePathByChars);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; \
}<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkDICOMReader* reader = \
vtkDICOMReader::New();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkImageData* \
imageData = reader-&gt;GetOutput();<br><br>Thanks<br>Liu \
Peng<br>	在2017-08-28,"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; 写道:  <blockquote \
id="m_5567654153334962732gmail-m_815751471093880078gmail-m_-1172525414657701273m_3909642038269937258isReplyContent" \
style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid \
                rgb(204,204,204)">
	-----原始邮件-----<br>
	<b>发件人:</b>"David Gobbi" &lt;<a href="mailto:david.gobbi@gmail.com" \
target="_blank">david.gobbi@gmail.com</a>&gt; <br>  \
<b>发送时间:</b>2017年08月28日 星期一<br>  <b>收件人:</b>"Liu_tj" &lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;<br>  \
<b>抄送:</b>"vtkusers" &lt;<a href="mailto:vtkusers@vtk.org" \
target="_blank">vtkusers@vtk.org</a>&gt;<br>  <b>主题:</b>Re: What ditermines \
whether the slice order should be reversed?<div><div \
class="m_5567654153334962732gmail-m_815751471093880078gmail-m_-1172525414657701273h5"><br>
 <br><div dir="ltr">Hi Liu Peng,<div><br></div><div>The vtkDICOMReader sorts \
according to the Image Plane Module:</div><div><a \
href="http://dicom.nema.org/MEDICAL/dicom/current/output/chtml/part03/sect_C.7.6.2.html" \
target="_blank">http://dicom.nema.org/MEDICAL/<wbr>dicom/current/output/chtml/par<wbr>t03/sect_C.7.6.2.html</wbr></wbr></a></div><div>That \
is, the slices are sorted in a manner such that the VTK image data has a right-handed \
coordinate system (called an RCS in the link above).</div><div><br></div><div>Sorting \
the slices to get an RCS means that sometimes the slices will be sorted the same as \
the InstanceNumber, and sometimes they will be sorted opposite to InstanceNumber, \
depending on the order in which scanner ordered the \
slices.</div><div><br></div><div>You can perform the sorting yourself by calling \
reader-&gt;SortingOff().&nbsp; If Sorting is Off, the reader will take the slices in \
the same order as the vtkStringArray that you passed to \
reader-&gt;SetFileNames().</div><div><br></div><div>If you send me the block of code \
where you set up and call the reader, then I might be able to provide more \
help.&nbsp; Don't forget to also say what versions of VTK and vtk-dicom you are \
using.</div><div><br></div><div>Cheers,</div><div>&nbsp;- \
David</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Sun, Aug 27, 2017 at 10:41 AM, Liu_tj <span dir="ltr">&lt;<a \
href="mailto:tjlp@netease.com" target="_blank">tjlp@netease.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div>Hi,</div><div><br></div><div>I have a \
question about the DICOM slice order. I use the DICOM reader by David Gobbi to read \
the slice series to vtkImageData. And I found that the oder is the same as the order \
by DICOM instanceNumber tag. However, some doctors tell me that the order should be \
reversed because the scan should start from head to foot. \
<br></div><div><br></div><div>@David, if I need to reverse, how to achieve that by \
your DICOM reader?</div><div><br></div><div>Thanks</div><div>Liu \
Peng<br></div></blockquote></div></div></div></div></blockquote></wbr></wbr></wbr></bl \
ockquote></div></div></div></div></div></blockquote></blockquote></div><br></div></div>
 </div></div></blockquote></wbr></wbr></blockquote></div><br></div></div></div>
</div></div></blockquote><br><br><span \
title="neteasefooter"><p>&nbsp;</p></span></blockquote></div><br></div></div> \
</blockquote><br><br><span title="neteasefooter"><p>&nbsp;</p></span>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


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

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