[Insight-users] How to call a destructor?
robert tamburo
robert.tamburo at gmail.com
Wed Jan 12 13:28:08 EST 2011
I see.
How about doing something like this?
typedef itk::LineConstIterator<ImageType> IteratorType;
ImageType::IndexType imageIndex;
ImageType::IndexType farPoint;
while()
{
imageIndex = something;
farPoint = somethingelse;
IteratorType it(image, imageIndex, farPoint);
while(!it.IsAtEnd())
{
// do stuff
}
}
On Wed, Jan 12, 2011 at 12:46 PM, Sameer Zaheer <bless.sins at gmail.com> wrote:
> Hi Robert,
>
> Thanks, for your response. It appears to be that
> ImageSliceIteratorWithIndex iterates along a slice, where a slice is
> defined as a 2D plane spanned by two vectors pointing along orthogonal
> coordinate axes.
>
> However, I would like to be able to iterate over a 2D plane spanned by
> two vectors that mostly will not point in the direction of coordinate
> axes, but may point in a non-orthogonal direction (say, <2,1,-3>).
> LineConstIterator allows me to iterate in a random direction (by
> allowing me to arbitrarily set the destination point), but only in 1D.
>
> Thanks,
> Sameer
>
> On Wed, Jan 12, 2011 at 12:18 PM, robert tamburo
> <robert.tamburo at gmail.com> wrote:
>> ImageSliceIteratorWithIndex iterates along planes (slices) of an image.
>>
>> On Wed, Jan 12, 2011 at 11:49 AM, Sameer Zaheer <bless.sins at gmail.com> wrote:
>>> Hi,
>>> I'm having some troubles with calling a destructor to a LineConstIterator
>>> object. My code looks something like this:
>>> typedef itk::LineConstIterator<ImageType> IteratorType;
>>> //define image
>>> //define imageIndex and farPoint
>>> IteratorType it(image, imageIndex, farPoint);
>>> IteratorType ~it();
>>> The reason I want to destroy the object is because I want to use it again,
>>> but with different firstIndex and lastIndex (I'm using iterator in a while
>>> loop). So you know how to set the firstIndex and lastIndex of the iterator
>>> (after it has been created), that could work too.
>>> And the reason I'm repeatedly setting the firstIndex and lastIndex, is
>>> because I want to iterate over a plane (my image is 3D), and didn't find any
>>> class that does that. Again, if there is such a class, let me know.
>>> Thanks,
>>> --
>>> Sameer Zaheer
>>> Engineering Science 1T0+PEY
>>> University of Toronto
>>>
>>> _____________________________________
>>> 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
>>>
>>>
>>
>
>
>
> --
> Sameer Zaheer
> Engineering Science 1T0+PEY
> University of Toronto
>
More information about the Insight-users
mailing list