Re: [ITK-users] [ITK] Image conversion from 3D volume to 2D slices

Dženan Zukić <[email protected]> Wed, 8 May 2019 11:48:45 -0400
Newsgroups gmane.comp.lib.itk.user
Message-ID <CAPf2UMRfBpwshc49p6_=6hymV+eb+J72vQpwCinO1SCjd5r=OQ@mail.gmail.com>
--===============1744398698==
Content-Type: multipart/alternative; boundary="0000000000007a7cc20588624500"

--0000000000007a7cc20588624500
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

If the input and output pixel types are different, extract filter does
simple casting. That causes the effect you have observed. You need to use
RescaleIntensityImageFilter
<https://itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html>
either
before or after the extract. Have the extract filter use the same input and
output pixel type.

On Wed, May 8, 2019 at 11:44 AM Shrabani Ghosh <[email protected]>
wrote:

> I am using   unsigned char as output pixel and signed short as input
> pixel.
>
> On Wed, May 8, 2019 at 10:19 AM D=C5=BEenan Zuki=C4=87 <[email protected]=
> wrote:
>
>> You need to use a different pixel type. You might be using char, and
>> needing to use unsigned char or short.
>>
>> On Wed, May 8, 2019 at 2:17 AM Shrabani Ghosh <[email protected]>
>> wrote:
>>
>>> I have tried different direction matrix collapse strategies. But still,
>>> I am
>>> getting the same. The slices are coming out like this.
>>>
>>>
>>> <http://itk-insight-users.2283740.n2.nabble.com/file/t396636/slice1.png=
>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/
>>> 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:
>>> https://itk.org/mailman/listinfo/insight-users
>>> The ITK community is transitioning from this mailing list to
>>> discourse.itk.org. Please join us there!
>>> ________________________________________
>>> Community mailing list
>>> [email protected]
>>> https://itk.org/mailman/listinfo/community
>>>
>>

--0000000000007a7cc20588624500
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif;font-size:small">If the input and output pixel types are differe=
nt, extract filter does simple casting. That causes the effect you have obs=
erved. You need to use <a href=3D"https://itk.org/Doxygen/html/classitk_1_1=
RescaleIntensityImageFilter.html">RescaleIntensityImageFilter</a>=C2=A0eith=
er before or after the extract. Have the extract filter use the same input =
and output pixel type.</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Wed, May 8, 2019 at 11:44 AM Shrabani Ghos=
h &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr">I am using=C2=A0

<span style=3D"font-family:verdana,sans-serif">=C2=A0unsigned char as outpu=
t pixel and signed short as input pixel.</span></div><br><div class=3D"gmai=
l_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, May 8, 2019 at 10:19=
 AM D=C5=BEenan Zuki=C4=87 &lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20=
4,204,204);padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_default" =
style=3D"font-family:verdana,sans-serif;font-size:small">You need to use a =
different pixel type. You might be using char, and needing to use unsigned =
char or short.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" c=
lass=3D"gmail_attr">On Wed, May 8, 2019 at 2:17 AM Shrabani Ghosh &lt;<a hr=
ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
om</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">I have tried different direction matrix collapse strategies. But still, I=
 am<br>
getting the same. The slices are coming out like this. <br>
<br>
<br>
&lt;<a href=3D"http://itk-insight-users.2283740.n2.nabble.com/file/t396636/=
slice1.png" rel=3D"noreferrer" target=3D"_blank">http://itk-insight-users.2=
283740.n2.nabble.com/file/t396636/slice1.png</a>&gt; <br>
<br>
<br>
<br>
--<br>
Sent from: <a href=3D"http://itk-insight-users.2283740.n2.nabble.com/" rel=
=3D"noreferrer" target=3D"_blank">http://itk-insight-users.2283740.n2.nabbl=
e.com/</a><br>
The ITK community is transitioning from this mailing list to <a href=3D"htt=
p://discourse.itk.org" rel=3D"noreferrer" target=3D"_blank">discourse.itk.o=
rg</a>. Please join us there!<br>
________________________________<br>
Powered by <a href=3D"http://www.kitware.com" rel=3D"noreferrer" target=3D"=
_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href=3D"http://www.kitware.com/opensource/opensource.html" rel=3D"norefe=
rrer" target=3D"_blank">http://www.kitware.com/opensource/opensource.html</=
a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href=3D"http://www.kitware.com/products/protraining.php" rel=3D"noreferr=
er" target=3D"_blank">http://www.kitware.com/products/protraining.php</a><b=
r>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" rel=3D"noreferrer" target=3D"_b=
lank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"https://itk.org/mailman/listinfo/insight-users" rel=3D"noreferre=
r" target=3D"_blank">https://itk.org/mailman/listinfo/insight-users</a><br>
The ITK community is transitioning from this mailing list to <a href=3D"htt=
p://discourse.itk.org" rel=3D"noreferrer" target=3D"_blank">discourse.itk.o=
rg</a>. Please join us there!<br>
________________________________________<br>
Community mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a=
><br>
<a href=3D"https://itk.org/mailman/listinfo/community" rel=3D"noreferrer" t=
arget=3D"_blank">https://itk.org/mailman/listinfo/community</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>

--0000000000007a7cc20588624500--

--===============1744398698==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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:
https://itk.org/mailman/listinfo/insight-users

--===============1744398698==--