[Insight-users] Boundary conditions

Cory Quammen cquammen at cs.unc.edu
Wed Jan 18 14:16:49 EST 2012


Kevin,

No need to do an expensive paste into a new image buffer. You can
instead insert a ChangeInfromationImageFilter after your padding
filter. See http://www.itk.org/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html

It's going to look like

typedef ChangeInformationImageFilter< ImageType > InfoFilterType;
InfoFilterType::Pointer indexChangeFilter = InfoFilterType::New();
indexChangeFilter->ChangeRegionOn();
InfoFilterType::OutputImageOffsetValueType indexShift[2];
indexShift[0] = -3;
indexShift[1] =  5;
indexChangeFilter->SetOutputOffset( indexShift );
indexChangeFilter->SetInput( ... );

This example code will merely change the region information - the
index, specifically - of the output image rather than making a copy of
the image.

Hope that helps.

Cory

On Wed, Jan 18, 2012 at 9:29 AM, Kevin Keraudren
<kevin.keraudren10 at imperial.ac.uk> wrote:
> Hi,
>
> Speaking about ITK 4.0,
>
> 1. Is there a generic method I could call for any ITK filter to tweak its
> boundary conditions (behaviour on the boundaries of the image, like zero
> padding, warping or mirroring)?
> The filter I mean to use it for is
> ScalarChanAndVeseSparseLevelSetImageFilter, but I am also interested by the
> answer for any other filter.
>
> 2. Thinking there would be no such generic method, I thought about padding
> my input images myself, and cropping the result to get back the correct
> size. I am using MirrorPadImageFilter. But the padding filters introduce
> negative indices in the image, which break
> ScalarChanAndVeseSparseLevelSetImageFilter. Here:
> https://issues.itk.org/jira/browse/HISTITK-1154
> NeighborhoodIterator is said not to handle negative indices.
>
> The error message I have is: "Requested region is (at least partially)
> outside the largest possible region."
>
> I would like to do mirroring padding, so I need to change the negative
> index. Here:
> http://www.itk.org/pipermail/insight-users/2008-July/026867.html
> it is suggested to paste the image in a new image to get back a {0,0,0}
> index.
>
> What would be the easiest way to mirror pad and still have a starting index
> {0,0,0}?
> Does anyone has comments on the above ITK bug as it seems closely related to
> my issue?
>
> Thanks for your help,
>
> Kind regards,
>
> Kevin
>
> _____________________________________
> 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.html
>
> 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



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill


More information about the Insight-users mailing list