[Insight-users] Gradient Anisotropic Diffusion Filter with 3D
Ultrasound data
Luis Ibanez
luis.ibanez at kitware.com
Wed Apr 27 11:43:46 EDT 2005
Hi Firebird,
Please increase the number of iterations.
Four iterations is not enough.
You may have to go as high as 50 or 100 iterations.
Remember that what you are doing is simulating the physical process
of the diffusion equation in an environment where conductance is
variable on each point of space.
You may have to increase the conductance parameter also.
The Value 1.0 is too low. A value of 3.0 is more commonly used.
Please make sure that you are compiling your code for Release (if you
are on windows) or with optimization if you are on Linux.
Regards,
Luis
------------------------------
firebird at medison.com wrote:
>
> Hello, everyone,
>
> I test Gradient Anisotropic Diffusion Filter with our 3D Ultrasound
> data, but there was not any change in 3D Ultrasound data.
>
> What's wrong? Could you check following code, please?
>
> Thank you.
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> /* pVolData : Pointer of 8bit Volume Data Buffer ( ex: size - 312 x 84
> x 44 )
> pOutoutData : Pointer of 8bit Output Data Buffer (same size of
> pVolData buffer)
> */
> void DiffusionFilter( unsigned char *pVolData, unsigned char
> *pOutputData, int xsize, int ysize, int zsize )
> {
> const unsigned int volume_size = xsize * ysize * zsize;
>
> typedef unsigned char PixelType;
>
> const unsigned int Dimension = 3;
>
> typedef itk::Image< PixelType, Dimension > ImageType;
>
> typedef itk::ImportImageFilter< PixelType, Dimension >
> ImportFilterType;
>
> /*-------- Set Input Data with ImportFilter --------*/
> ImportFilterType::Pointer importFilter = ImportFilterType::New();
>
> ImportFiterType::SizeType size;
> size[0] = xsize;
> size[1] = ysize;
> size[2] = zsize;
>
> ImportFilterType::IndexType start;
> start.Fill(0);
>
> ImportFIlterType::RegionType region;
> region.SetIndex( start );
> region.SetSize( size );
>
> importFilter->SetRegion( region );
>
> double origin[ Dimension ];
> origin[0] = 0.0; origin[1] = 0.0; origin[2] = 0.0;
>
> importFilter->SetOrigin( origin );
>
> double spacing[ Dimension ];
> spacing[0] = 1.0; spacing[1] = 1.0; spacing[2] = 1.0;
>
> importFilter->SetSpacing( spacing );
>
> importFilter->SetImportPointer( pVolData, volume_size, false );
>
> /*------------Apply Gradient Anisotropic Diffusion Filter to
> Input Data ---------------*/
> typedef itk::Image< PixelType, Dimension > InputImageType;
> typedef itk::Image< PixelType, Dimension > OutputImageType;
>
> typedef itk::GradientAnisotropicDiffusionImageFilter<
> InputImageType, OutputImageType > FilterType;
> FilterType::Pointer filter = FilterType::New();
>
> filter->SetInput( importFilter->GetOutput() );
>
> const unsigned int numberOfIterations = 4;
> const double timeStep = 0.125;
> const double conductance = 1.0;
>
> filter->SetNumberOfIterations( numberOfIterations );
> filter->SetTimeStep( timeStep );
> filter->SetConductanceParameter( conductance );
>
> filter->Update(); /* take so long time....*/
>
> /*
> typedef itk::RescaleIntensityImageFilter<PixelType, PixelType >
> RescaleFilterType;
>
> RescaleFilterType::Pointer rescaler = RescaleFilterType::New();
> rescaler->SetOutputMinimum( 0 );
> rescaler->SetOutputMaximum( 255 );
>
> rescaler->SetInput( filter->GetOutput() );
> */
> memcpy( pOutputData, filter->GetOutput()->GetBufferPointer(),
> sizeof(unsigned char)*volume_size );
> }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list