[Insight-users] image region iterator

David Doria daviddoria at gmail.com
Fri Nov 2 07:27:38 EDT 2012


On Fri, Nov 2, 2012 at 5:31 AM, Wyke Huizinga <wykehuizinga at gmail.com> wrote:
> Hi,
>>
>>
>> I'm having a problem with the image iterator.
>> I want to iterate over a specific volume in a 4D image.
>> What I do is the following:
>>
>> I loop over the volumes in the 4D image. Each new loop the region for the
>> image iterator changes.
>> The region is put into a function which should iterate then over the
>> specific volume.
>>
>> The region size is set to the size of a volume and the size of the 4th
>> dimension is set to 0 (in this case: [79 107 60 0])
>> The region index is set to [0 0 0 loopindex].
>>
>> Both the region and the image are passed in correctly into the function.
>>
>> However, the iterator says it is at its end before even starting the loop.
>> The code can be found here: http://pastebin.com/PArvffSq
>> It goes wrong at line 55.
>>
>> I'm a bit of a newby in both ITK and C++, so forgive me if the code looks
>> bad.
>>
>> Thanks for your help,
>>
>>
>> Wyke Huizinga

Please create the smallest possible, stand alone, compilable example.
For example, replace the input image with a hard coded image. Remove
all of the random number generation, etc. It is much more manageable
for us to step through 20 lines than 130.

David


More information about the Insight-users mailing list