[ITK-users] [ITK] Extract slice from ResampleFilter

Dženan Zukić dzenanz at gmail.com
Thu Apr 13 13:44:58 EDT 2017


The target region is the region (index and size) you set in the resample
filter. It is just a difference in terminology between you and me.

I took a look at the images you supplied. Because of transformations, this
is hard to debug.

I realized it would be easier to construct the output image to be in the
same physical space as the input image, and have identity transform applied
to resample filter (used by default). Pseudo-code:

ImageType::DirectionType dir;
ST.normalize();
dir[0]=ST; //vector from first point to second
vec3 second=normal.cross(ST); //make the second vector orthogonal to first
and the normal
second.normalize();
dir[1]=second;
normal.normalize();
dir[2]=normal;
filter->SetOutputDirection(dir);
filter->SetOrigin(traj_start);
//it will be more math to compute proper size (so that resampled image ends
at traj_end), and proper spacing (project original spacing onto coordinate
system established by new dir matrix or use isotropic spacing equal to
cubic root of sp[0]*sp[1]*sp[2]).

With this approach you can use e.g. Slicer <https://www.slicer.org/> to
look at both the original and resampled images, and also define fiducial
points for your 3 points of interest.

P.S. If you share any more images, please save them with compression
applied (writer->SetUseCompression(true);).

Regards,
Dženan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)

On Thu, Apr 13, 2017 at 11:33 AM, sidharta <sidharta.gupta93 at gmail.com>
wrote:

> So if you think the code is correct and is doing what you suggested (or
> what
> I think it should do using the eulerTransform), you mentioned setting
> targetRegionIndex in ResampleFilter to get one single slice. I don't see
> this targetRegionIndex or do you mean set origin. I am going to send you
> the
> link to the dropbox folder in a private mail.
>
>
>
> --
> View this message in context: http://itk-users.7.n7.nabble.
> com/Extract-slice-from-ResampleFilter-tp38074p38118.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> 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/20170413/b150d542/attachment.html>


More information about the Insight-users mailing list