[Insight-users] erosion performance for binary images

M.Staring at lumc.nl M.Staring at lumc.nl
Tue Jun 9 03:53:52 EDT 2009


Hi Richard,


> -----Original Message-----
> 
> Hi,
> 
> I didn't see the last question regarding the scale. I'm not exactly
> sure what your code is doing, but it shouldn't be necessary to set the
> scale - the distance transform helper should do that for you, and
> hence you should be able to threshold at the size (in mm), that you
> want. I think you can also turn of the voxel spacing usage.

my current code is like:

typedef itk::ParabolicErodeImageFilter< ImageType, ImageType >
ParabolicType;
ParabolicType::Pointer parabolic = ParabolicType::New();
parabolic->SetInput( reader->GetOutput() );
parabolic->SetUseImageSpacing( false );
parabolic->SetScale( radii[ i ]*radii[ i ]/2 + 1 );
parabolic->Update();

So, I am not using distance transforms.

Was this not what you meant earlier ?

> 
> However if you are calling the parabolic erode filter directly then
> you'll need to set the scale, and what you've done is probably right -
> check the distance transform code to be sure. There are lots of ways
> you could do this, and in practice it won't make much difference. The
> parabolic morph filters do operations that have outputs related to the
> square of the distance, and this needs to be taken into account when
> you threshold. Fiddling the scale parameter will adjust things too -
> I'd need to see the code to ensure that it makes sense.

I could find in your code that you are using the squared voxel diagonal
length in the variable m_MaxDist. But you also set the scale fixed to
0.5 in the constructor. So, I could not find confirmation in your code
that what I'm doing is correct. Do you have some more pointers for me?

> 
> It is surprising how much the VHGW times bounce around.

I'm testing under windows and that does not seem to be as reliable as my
previous experience under linux. VHGW is multi-threaded, maybe I should
set the number of threads to 1 for testing, to get more reproducible
results.

> 
> PS - I presume that if you're using the unsigned version of the DT
> filter, assuming you're using the DT filters at all.

See above, so I'm not using distance transforms, but erosion directly.
The distance transforms do an erosion and dilation internally and then
threshold. That would give the same results, but be more than twice as
slow. Right ?

Regards,

Marius


More information about the Insight-users mailing list