<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Thanks Chao Wu, <br>
<br>
You're right, I was mistaken : the cast filter is not required in
this case. It is needed, on the other hand, to increase the
dimension of an image. So in this case, Amjad, you don't need it. <br>
<br>
Cyril<br>
<br>
<div class="moz-cite-prefix">On 05/04/2016 02:44 PM, Chao Wu wrote:<br>
</div>
<blockquote
cite="mid:CAH+sHrWxHGt++iqCQWJbab37PWMBgxtgm_S=4h2QcmJ-ABpY8A@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">A small add-on (copied from ITK document):
<div><br>
<div>ExtractImageFilter also collapses dimensions so that the
input image may have more dimensions than the output image
(i.e. 4-D input image to a 3-D output image). To specify
what dimensions to collapse, the ExtractionRegion must be
specified. For any dimension dim where
ExtractionRegion.Size[dim] = 0, that dimension is collapsed.
The index to collapse on is specified by
ExtractionRegion.Index[dim]. For example, we have a image 4D
= a 4x4x4x4 image, and we want to get a 3D image, 3D = a
4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd
"time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0]
and ExtractionRegion.Index = [0,0,0,2].<br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Chao</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-05-04 13:27 GMT+02:00 Cyril Mory <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:cyril.mory@uclouvain.be" target="_blank">cyril.mory@uclouvain.be</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Hi Amjad,<br>
<br>
You can use an ITK extract filter to extract a region that
corresponds to one of your slices (along the axis you
want). The output of the extract filter will be 3D, so
you will need to cast it into a 2D images using an ITK
cast filter. <br>
<br>
Cyril
<div>
<div class="h5"><br>
<br>
<div>On 05/04/2016 11:04 AM, AMJAD N wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I have wrote code for saving output volume
stack as *.tiff. Currently I am getting output
of XY axis. What should I do in order to get the
other axes. </div>
<div>My code is shown below.</div>
<div><br>
</div>
<div>
<div> typedef
itk::StreamingImageFilter<FloatImageType,
FloatImageType> StreamerType;</div>
<div><span style="white-space:pre-wrap"> </span>StreamerType::Pointer
streamerBP = StreamerType::New();</div>
<div><span style="white-space:pre-wrap"> </span>streamerBP->SetInput(feldkampCUDA->GetOutput());</div>
<div><span style="white-space:pre-wrap"> </span>streamerBP->SetNumberOfStreamDivisions(8);</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>typedef
itk::Image< float, 2 > Image2DType;</div>
<div><span style="white-space:pre-wrap"> </span>typedef
itk::ImageSeriesWriter< FloatImageType,
Image2DType > WriterType;</div>
<div><span style="white-space:pre-wrap"> </span>WriterType::Pointer
writer = WriterType::New();</div>
<div><span style="white-space:pre-wrap"> </span>writer->SetInput(streamerBP->GetOutput());</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>typedef
itk::NumericSeriesFileNames
NameGeneratorType;</div>
<div><span style="white-space:pre-wrap"> </span>NameGeneratorType::Pointer
nameGenerator = NameGeneratorType::New();</div>
<div><span style="white-space:pre-wrap"> </span>nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif");</div>
<div><span style="white-space:pre-wrap"> </span>nameGenerator->SetStartIndex(0);</div>
<div><span style="white-space:pre-wrap"> </span>nameGenerator->SetEndIndex(sizeOutput[2]
- 1); // sizeOutput[2] is the Z-axis value of
//reconstructed volume</div>
<div><span style="white-space:pre-wrap"> </span>nameGenerator->SetIncrementIndex(1);</div>
<div><span style="white-space:pre-wrap"> </span>writer->SetFileNames(nameGenerator->GetFileNames());</div>
<div><span style="white-space:pre-wrap"> </span>writer->SetUseCompression(true);</div>
<div><span style="white-space:pre-wrap"> </span>writer->Update();</div>
</div>
<div><br>
</div>
<div>PS: My reconstruction works fine.</div>
<div><br>
</div>
<div>Thanks and Regards</div>
<div><br>
</div>
<div>AMJAD N</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
Rtk-users mailing list
<a moz-do-not-send="true" href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a>
<a moz-do-not-send="true" href="http://public.kitware.com/mailman/listinfo/rtk-users" target="_blank">http://public.kitware.com/mailman/listinfo/rtk-users</a>
</pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
Rtk-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:Rtk-users@public.kitware.com">Rtk-users@public.kitware.com</a><br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/rtk-users"
rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/rtk-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>