<div dir="ltr">Hey ITK community,<div><br></div><div style>I've got a problem I've been struggling with for a few weeks now and would like some assistance.</div><div style><br></div><div style>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. </div>
<div style><br></div><div style>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).</div>
<div style><br></div><div style>I've attempted using a paste image filter in a loop to paste each slice one at a time</div><div style>size=(Nx,Ny,1), destinationIndex=(0,0,f(z));</div><div style>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.</div>
<div style><br></div><div style>I've attempted using a resample image filter, but my knowledge of transformations was lacking and that failed also.</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>Cheers,</div><div style>Phil</div></div>