[vtkusers] Multiscale Vessel Enhancement (vtkImageSeparableConvolution)

matheus_viana vianamp at gmail.com
Wed Jun 6 16:44:51 EDT 2012


Hi guys.

I'm trying to implement the Vessel Enhancement Filter of Frangi et. al. In
order to calculate the partial derivative Dxx, I'm doing this:

float x, g, gx, gxx;
int *dim = ImageData -> GetDimensions();

vtkFloatArray *FX = vtkFloatArray::New();
vtkFloatArray *FX_X = vtkFloatArray::New();
vtkFloatArray *FX_X2 = vtkFloatArray::New();
FX -> SetNumberOfTuples(kernel_size);
FX_X -> SetNumberOfTuples(kernel_size);
FX_X2 -> SetNumberOfTuples(kernel_size);

for (int i = 0; i < kernel_size; i++) {
	x = i - (kernel_size-1)/2;
	g   = exp(-0.5*pow(x/std,2.0)) / sqrt (2.0 * 3.1415 * std *std);
	gx  = x/pow(std,4.0)*g;
	gxx = (x*x/pow(std,4.0)-pow(std,-2.0))*g;
	FX    -> InsertValue(i,g);
	FX_X  -> InsertValue(i,gx);
	FX_X2 -> InsertValue(i,gxx);
}

vtkImageSeparableConvolution *ConvolutionXX =
vtkImageSeparableConvolution::New();
ConvolutionXX -> SetInput(ImageData);
ConvolutionXX -> SetDimensionality(3);
ConvolutionXX -> SetXKernel(FX_X2);
ConvolutionXX -> SetYKernel(FX);
ConvolutionXX -> SetZKernel(FX);
ConvolutionXX -> Update();
vtkFloatArray *Dxx = (vtkFloatArray*)ConvolutionXX -> GetOutput() ->
GetPointData() -> GetScalars();

and the same is done for the other derivatives, Dyy, Dzz, Dxy...

Could anyone tell me if it makes sense? I'm asking cause the final result
isn't good, but I'm not sure where is the problem.

Thanks in advance.
Matheus Viana

--
View this message in context: http://vtk.1045678.n5.nabble.com/Multiscale-Vessel-Enhancement-vtkImageSeparableConvolution-tp5713628.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list