[ITK] [ITK-users] Using PermuteAxesImageFilter incorrectly

Ricky Singla rsingla92 at gmail.com
Thu May 15 20:13:23 EDT 2014


Hi there,

I'm having some trouble using the PermuteAxesImageFilter.  I have an image,
which I know is allocated correctly and has values in its buffer, that i'm
trying to transpose (swap the X and Y axes). PermuteAxesImageFilter looked
the most suitable. After that filter, I'm subtracting a constant from the
image using the SubtractImageFilter. I've used the PermuteAxesImageFilter
example as a reference, but evidently I'm forgetting something.

Here's a code snip:

void func()
{
typedef itk::PermuteAxesImageFilter<ImageType> PermuteAxesType;
 typedef itk::SubtractImageFilter<ImageType, ImageType>
SubtractImageFilterType;

// Allocate Y
 // define and set magicalConstant, which is of type ImageType::PixelType

itk::FixedArray<unsigned int, 2> order; order[0] = 1; order[1] = 0;

PermuteAxesType::Pointer permuteAxes = PermuteAxesType::New();
permuteAxes->SetInput(Y);
 permuteAxes->SetOrder(order);
permuteAxes->Update();

SubtractImageFilterType::Pointer subtractFilter =
SubtractImageFilterType::New();
 subtractFilter->SetInput(permuteAxes->GetOutput());
subtractFilter->SetConstant(magicalConstant);

Y = subtractFilter->GetOutput(); // transposed - magicalConstant

  // other stuff
}

Any ideas as to what I'm doing wrong here?

Thanks.


Ricky Singla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140515/57d59775/attachment.html>
-------------- next part --------------
_____________________________________
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://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list