[Insight-users] ITK Rearrange slices in volume

Phillip Ward pgwar1 at student.monash.edu
Sun Apr 7 02:42:53 EDT 2013


Hey ITK community,

I've got a problem I've been struggling with for a few weeks now and would
like some assistance.

I have a volume and I would like to rearrange the slices in it, i.e., remap
the third dimension of the volume. The volume is read from a single file,
so renaming image files or reading in a different order is not suitable.

Right now, the even slices are first (1,15) and the odd slices are second
(16,30). So the map f(z) = (z%2 ? z/2 : Nz/2 + z/2), where Nz is the length
of the third dimension, interleaves the even and odd into their correct
order (for even Nz).

I've attempted using a paste image filter in a loop to paste each slice one
at a time
size=(Nx,Ny,1), destinationIndex=(0,0,f(z));
This produced a black image, which I suspect was a pipeline error on my
behalf, but I haven't been able to work out how to implement this correctly.

I've attempted using a resample image filter, but my knowledge of
transformations was lacking and that failed also.

I feel like there is an easier way to do this that I am perhaps
overlooking, but either way I cannot implement it and would appreciate some
advice.

Cheers,
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130407/5f5254ae/attachment.htm>


More information about the Insight-users mailing list