[Insight-users] Padding a volume

Miller, James V (Research) millerjv at crd.ge.com
Wed Apr 27 10:15:44 EDT 2005


I think mirror pad would work if padding by 1 pixel.

Another option: if the last slice is always empty, why not crop that slice out before calculating the gradients?  Then the zero flux condition should provide the results that you are looking for. But is sounds like you are do not want to make assumptions about the position of the phantom in the volume.

So basically, you want to make sure that your object is properly "capped" by the segmentation algorithm.

Jim


-----Original Message-----
From: Sigmund Augdal [mailto:sigmunau at stud.ntnu.no]On Behalf Of
sigmunau at idi.ntnu.no
Sent: Wednesday, April 27, 2005 10:03 AM
To: Miller, James V (Research)
Cc: Insight-users at itk.org
Subject: Re: [Insight-users] Padding a volume


On Wed, Apr 27, 2005 at 08:47:50AM -0400, Miller, James V (Research) wrote:
> The PadImageFilters do not use the BoundaryCondition objects. You are correct
> that there is a cut-and-paste error in the MirrorPad documentation.  
> 
> In WrapPadImageFilter, when a pixel needs to be assigned from outside the
> original volume, the value is taken from the opposite side of the image 
> (as if the image is a N-dimensional torus).  For example, if you want
> pixel at index -2, the value will be taken from the pixel at index (size-2).
> 
> In MirrorPadImageFilter, if you wanted the pixel at index -2, the value
> will be taken from the pixel at index 2.
This is in agreement with what my initial guess was, but I thought I should
ask before spending time testing.

> 
> I am guessing MirrorPadImageFilter will be the closest to what you want to do.
> But is not the same as a ZeroFlux boundary condition.
But am I right in assuming that it will be very close, when the padding is
only 1 voxel?

> If you would like, I could quickly write a filter that will actually pad an
> image using a specified BoundaryCondition (defaulting the ZeroFlux condition).
This would, in my oppinion, be a nice addition for further versions, but if
the mirrorpadimagefilter does what I want, then I rather save myself the
work of compiling the entire itk again.

> Note, that usually in ITK, we rely on the BoundaryCondition specified on 
> NeighborhoodIterators to provide out of image information rather than by
> padding an image.  The FaceCalculators are used to divide an image into
> several regions, one that will have no boundary conditions and rest with
> at least boundary conditions.  This allows us to iterate over the pixels 
> that do not have boundary conditions quickly and only check the boundary
> conditions on pixels that we know will need to have a boundary condition 
> designation.
I'm aware of this, and it seems to work well, so I will describe my problem
a bit more in detail. 

I have a CT-scan of the head of a phantom. The first slice cuts through the
neck of the phantom, the top of the head is in the second last slice and the
very last slice is empty. I want to segment the outer surface of the
phantom, and as the first step I calculate the gradient magnitude. The
calculation for the last output slice uses the second last input slice(with
the head), the last imput slice(empty) and the boundary condition(also empty
due to zero flux). all this causes. This results in a non-zero gradient
magnitude in that area of the output. Now, running fast-marching
segmentation(seeded from the outside), the front cannot propagate to enclose
the head at the very top, because the area has a gradient. Running marching
cubes on the output of the levelset segmentation results in the poor phantom
having a big hole in his head, where the surface looks like it is bent from
the inside and out.

Zero-padding will work if it is only done on the right side of the volume,
but if  the bottom part is padded with zero, the propating front may pass
around and into the phantom, which is largly hollow. And I want to make no
apriori assumption about the objects position in the volume, so I would like
to pad with the same method on all sides. That is why I thought of the
zero-flux method.

Maybe, given my problem explanation, there may exist some other simpler
metthod to solve my problem.

Sigmund
>
> Jim
> 
> 
> 
> -----Original Message-----
> From: insight-users-bounces at itk.org
> [mailto:insight-users-bounces at itk.org]On Behalf Of sigmunau at idi.ntnu.no
> Sent: Wednesday, April 27, 2005 6:40 AM
> To: Insight-users at itk.org
> Subject: [Insight-users] Padding a volume
> 
> 
> I need to pad a volume with one voxel on all sides. I want the padding to
> behave somewhat similar to ZeroFluxNeumannBoundaryCondition, but I fail to
> find how I can use a BoundaryCondition object in a PadImageFilter. Since I
> only need one voxel on each side, I think maybe WrapPadImageFilter or
> MirrorPadImageFilter will work, but their documentation is a bit unclear. As
> a matter of fact the documentation seems to be exactly the same for both of
> those classes.
> 
> Can anyone tell me which of these will do what I need, or if there are any
> other ways to do it?
> 
> -- 
> Sigmund Augdal
> Edgar B. Schieldropsv 29-14
> N-7033 Trondheim
> Norway
> tlf: 91809129
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

-- 
Sigmund Augdal
Edgar B. Schieldropsv 29-14
N-7033 Trondheim
Norway
tlf: 91809129


More information about the Insight-users mailing list