[Insight-users] Mask+Neumann Boundary Condition

Luis Ibanez luis.ibanez at kitware.com
Sun Nov 8 19:50:19 EST 2009


Hi Brady,

Thanks a lot for the clarification.

In order to address this need, you will have to customize
a new Iterator class.

You may want to start from the itkNeighborhood iterator,
which provides the walking capability (although it needs
to be modified) and the ability to visit the neighbors of
the current pixel.

The Neighborhood iterators already support the use
of BoundaryConditions,... although their implementation
would have to be modified in your case, since the values
that need to be computed outside of the ROI would have
to follow a rule that doesn't require borders that are aligned
with the axis.

---

Regarding the Walking capability, one efficient way of
implementing this iterator, would be to take advantage
of the new itkLabel classes in the Insight/Code/Review
directory.  They allow you to represent the ROI using
run-length-encoding, which in its turn will give you an
efficient guidance for walking over the inside of ROI
and will let you know how to jump from the end of one
ROI row to the beginning of the next.

These classes are described in the following Insight
Journal paper:

"Label object representation and manipulation with ITK"
 http://www.insight-journal.org/browse/publication/176
 http://hdl.handle.net/1926/584


This will not be a trivial task....

You are probably looking at a week-long session of coding.


Of course,
If you undertake this effort, we will strongly encourage you
to share it with the community, via a submission to the
Insight Journal    :-)


Please let us know if you have further questions,


       Thanks


             Luis


---------------------------------------------------------------------------------
On Sun, Nov 8, 2009 at 3:09 PM, Brady McCary <brady.mccary+ITK at gmail.com> wrote:
> Luis,
>
> A high-level description is:
>
> 1. Imagine an image with circular ROI.
> 2. Iterate a neighborhood over the ROI.
> 3. Use a BC when the neighborhood extends outside of the ROI.
>
> Said with more details:
>
> 1. Input images are rectangular.
> 2. I want to be able to set a ROI and perform a computation only over
> this ROI. The ROI will in general be non-rectangular.
> 3. This computation requires a neighborhood for each pixel in the ROI.
> 4. Some pixels in the ROI will be on the boundary of the ROI and
> therefor the neighborhood will extend outside of the ROI.
> 5. In the case where pixels in the neighborhood are outside of the
> ROI, I want to be able to use a boundary condition to compute their
> values.
> 6. A Neumann-like BC will be fine.
> 7. Note that the usual grid-aligned, rectangular region is a convex
> case (see next note).
> 8. Note that defining the Neumann BC for a non-convex region is more
> complicated that the convex case.
>
> I hope this clarifies my post. Please let me know if you need more information.
>
> Brady
>
> On Sun, Nov 8, 2009 at 1:20 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Hi Brady,
>>
>> There are two mentions of a "Mask" in your email,
>> and I'm wondering if we are interpreting them correctly.
>>
>> You say that you want an iterators that uses a
>>
>>                   "non-rectangular mask"
>>
>> do you mean that you want the iterator to visit all
>> the pixels of a non-rectangular region of the image ?
>>
>> You are probably aware of the difference between the
>> ITK ImageRegion iterators and the ITK Neighborhood
>> Iterators.
>>
>> The use of Boundary conditions is relevant for the
>> Neighborhood iterators, not for the RegionIterators.
>>
>> Could you please clarify if you are looking for
>> a Neighborhood iterator or not ?
>>
>> and whether you need to look at the neighbors of
>> every pixel in a particular pattern ?
>>
>> Maybe a high level description of what you are trying
>> to achieve, will be very helpful here.
>>
>>
>>      Thanks
>>
>>
>>           Luis
>>
>>
>> ----------------------------------------------------------------------------------------------------------
>> On Tue, Nov 3, 2009 at 4:15 PM, Brady McCary <brady.mccary+ITK at gmail.com> wrote:
>>> insight-users,
>>>
>>> Is there an neighborhood iterator which will use a non-rectangular
>>> mask and a Neumann boundary condition? I.e., I would like an iterator
>>> that will
>>>
>>> 1. Only iterate over a mask I supply (e.g., an itk::ImageMaskSpatialObject).
>>> 2. Use the Neumann boundary condition to compute a neighborhood, using
>>> information only within the mask.
>>>
>>> Brady
>>> _____________________________________
>>> 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
>>>
>>
>


More information about the Insight-users mailing list