[Insight-users] Voxel access for images in itk
Ruben Schilling
r.b.schilling at googlemail.com
Mon May 14 15:40:55 EDT 2007
Hi,
I am experiencing some trouble when I try to access images in a voxel
wise manner in itk. I try to make my points as clear and short as I can:
(1) I have no trouble reading images and writing images (I use TIF
stacks) in general. But when I try to e.g. copy some value from say
image 'A' to a newly constructed and allocated image via the methods
GetPixel (index) and SetPixel (index, value) (from itkImage.h) I do
not get write access past slice 110. I specifically tested accessing
random (and valid) slices via SetPixel (index, value) and couldn't
get anyhow past the 110th slice. Why is this?
Now to the second, related problem:
(2) I read then I would be better off using itk's Iterators. For my
problem I need to know the current position of the iterator and I
need to progress with the iterator in a linear manner. Thus I chose
the const and non-const versions of SliceIteratorWithIndex (I have 3D
image data in image stacks). Here I do have the problem, that for
efficiency I need to start iterating the line from the *begin* AND
the same lines from the *end* backwards. Unfortunatly there is no way
of moving this iterator directly to the end of a line (as there is
for other iterators, that are not having index and slice capabilities).
Is there any efficient solution in itk?
Best,
Ruben
More information about the Insight-users
mailing list