ImageDev

ScaleSpaceLogFilter2d

This filter applies a Laplacian of Gaussian (LoG) filter at different scales, to enhance circular or elliptical (blob-like) objects.

Access to parameter description

This filter enhances objects that appear bright on a dark background. For each pixel, the maximum LoG response and the scale providing this maximum response are recorded, and presented as two output images. Each LoG filter is normalized for scale-invariance. The scales are defined by the standard deviation of the gaussian kernel. The scales can be either isotropic, or different for each axis. In the latter case, the output scale image will indicate the geometric average of the standard deviations along each axis.

Reference:
S.V. Fotin, D.F. Yankelevitz, C.I. Henschke, and A.P. Reeves, A multiscale Laplacian of Gaussian (LoG) filtering approach to pulmonary nodule detection from whole-lung CT scans . @I Proceedings of the SPIE, vol.7260, id.72601Q, Medical Imaging 2009: Computer-Aided Diagnosis, Mar 2009.

Function Syntax

This function returns a ScaleSpaceLogFilter2dOutput structure containing outputImage, scaleTable and outputScaleImage.
// Output structure of the scaleSpaceLogFilter2d function.
struct ScaleSpaceLogFilter2dOutput
{
    /// The output image representing the maximum LoG response among all scale inputs. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float.
    std::shared_ptr< iolink::ImageView > outputImage;
    /// The output image from which each intensity represents the index of the selected scale. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to 8-bit unsigned integer. This image is not generated if selectIndexImage is set to False.
    std::shared_ptr< iolink::ImageView > outputScaleImage;
    /// The output table contains all couples of standard deviation values for X and Y axes used to compute each scale.
    std::shared_ptr< iolink::DataFrameView > scaleTable;
};

// Function prototype
ScaleSpaceLogFilter2dOutput scaleSpaceLogFilter2d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2d minimumStandardDeviation, iolink::Vector2d maximumStandardDeviation, uint32_t numberOfScales, ScaleSpaceLogFilter2d::Lightness lightness, bool selectIndexImage, std::shared_ptr< iolink::ImageView > outputImage = nullptr, std::shared_ptr< iolink::DataFrameView > scaleTable = nullptr, std::shared_ptr< iolink::ImageView > outputScaleImage = nullptr );
This function returns a tuple containing output_image, scale_table and output_scale_image.
// Function prototype.
scale_space_log_filter_2d(input_image: idt.ImageType,
                          minimum_standard_deviation: Union[Iterable[int], Iterable[float]] = [1, 1],
                          maximum_standard_deviation: Union[Iterable[int], Iterable[float]] = [1, 1],
                          number_of_scales: int = 1,
                          lightness: ScaleSpaceLogFilter2d.Lightness = ScaleSpaceLogFilter2d.Lightness.BRIGHT,
                          select_index_image: bool = False,
                          output_image: idt.ImageType = None,
                          scale_table: Union[iolink.DataFrameView, None] = None,
                          output_scale_image: idt.ImageType = None) -> Tuple[idt.ImageType, Union[iolink.DataFrameView, None], idt.ImageType]
This function returns a ScaleSpaceLogFilter2dOutput structure containing outputImage, scaleTable and outputScaleImage.
/// Output structure of the ScaleSpaceLogFilter2d function.
public struct ScaleSpaceLogFilter2dOutput
{
    /// 
    /// The output image representing the maximum LoG response among all scale inputs. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float.
    /// 
    public IOLink.ImageView outputImage;
    /// 
    /// The output image from which each intensity represents the index of the selected scale. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to 8-bit unsigned integer. This image is not generated if selectIndexImage is set to False.
    /// 
    public IOLink.ImageView outputScaleImage;
    /// 
    /// The output table contains all couples of standard deviation values for X and Y axes used to compute each scale.
    /// 
    public IOLink.DataFrameView scaleTable;
};

// Function prototype.
public static ScaleSpaceLogFilter2dOutput
ScaleSpaceLogFilter2d( IOLink.ImageView inputImage,
                       double[] minimumStandardDeviation = null,
                       double[] maximumStandardDeviation = null,
                       UInt32 numberOfScales = 1,
                       ScaleSpaceLogFilter2d.Lightness lightness = ImageDev.ScaleSpaceLogFilter2d.Lightness.BRIGHT,
                       bool selectIndexImage = false,
                       IOLink.ImageView outputImage = null,
                       IOLink.DataFrameView scaleTable = null,
                       IOLink.ImageView outputScaleImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. The image type can be integer or floating point. Image Grayscale nullptr
input
minimumStandardDeviation
The Minimum standard deviation for X and Y axes, in pixels. Vector2d Any value {1.f, 1.f}
input
maximumStandardDeviation
The Maximum standard deviation for X and Y axes, in pixels. Vector2d Any value {1.f, 1.f}
input
numberOfScales
The number of scales used for computing Laplacian of Gaussian filters. UInt32 [1, 255] 1
input
lightness
The lightness type of object to detect.
BRIGHT Bright objects are extracted from a dark background.
DARK Dark objects are extracted from a bright background.
Enumeration BRIGHT
input
selectIndexImage
The index image is generated only if set to true. Bool false
output
outputImage
The output image representing the maximum LoG response among all scale inputs. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. Image nullptr
output
scaleTable
The output table contains all couples of standard deviation values for X and Y axes used to compute each scale. DataFrameView nullptr
output
outputScaleImage
The output image from which each intensity represents the index of the selected scale. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to 8-bit unsigned integer. This image is not generated if selectIndexImage is set to False. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input grayscale image. The image type can be integer or floating point. image Grayscale None
input
minimum_standard_deviation
The Minimum standard deviation for X and Y axes, in pixels. vector2d Any value [1, 1]
input
maximum_standard_deviation
The Maximum standard deviation for X and Y axes, in pixels. vector2d Any value [1, 1]
input
number_of_scales
The number of scales used for computing Laplacian of Gaussian filters. uint32 [1, 255] 1
input
lightness
The lightness type of object to detect.
BRIGHT Bright objects are extracted from a dark background.
DARK Dark objects are extracted from a bright background.
enumeration BRIGHT
input
select_index_image
The index image is generated only if set to true. bool False
output
output_image
The output image representing the maximum LoG response among all scale inputs. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. image None
output
scale_table
The output table contains all couples of standard deviation values for X and Y axes used to compute each scale. data_frame_view None
output
output_scale_image
The output image from which each intensity represents the index of the selected scale. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to 8-bit unsigned integer. This image is not generated if selectIndexImage is set to False. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. The image type can be integer or floating point. Image Grayscale null
input
minimumStandardDeviation
The Minimum standard deviation for X and Y axes, in pixels. Vector2d Any value {1f, 1f}
input
maximumStandardDeviation
The Maximum standard deviation for X and Y axes, in pixels. Vector2d Any value {1f, 1f}
input
numberOfScales
The number of scales used for computing Laplacian of Gaussian filters. UInt32 [1, 255] 1
input
lightness
The lightness type of object to detect.
BRIGHT Bright objects are extracted from a dark background.
DARK Dark objects are extracted from a bright background.
Enumeration BRIGHT
input
selectIndexImage
The index image is generated only if set to true. Bool false
output
outputImage
The output image representing the maximum LoG response among all scale inputs. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to float. Image null
output
scaleTable
The output table contains all couples of standard deviation values for X and Y axes used to compute each scale. DataFrameView null
output
outputScaleImage
The output image from which each intensity represents the index of the selected scale. Its dimensions, calibration and interpretation are forced to the same values as the input image. Its type is forced to 8-bit unsigned integer. This image is not generated if selectIndexImage is set to False. Image null

Object Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

ScaleSpaceLogFilter2d scaleSpaceLogFilter2dAlgo;
scaleSpaceLogFilter2dAlgo.setInputImage( polystyrene );
scaleSpaceLogFilter2dAlgo.setMinimumStandardDeviation( {1.0, 1.0} );
scaleSpaceLogFilter2dAlgo.setMaximumStandardDeviation( {3.0, 3.0} );
scaleSpaceLogFilter2dAlgo.setNumberOfScales( 1 );
scaleSpaceLogFilter2dAlgo.setLightness( ScaleSpaceLogFilter2d::Lightness::BRIGHT );
scaleSpaceLogFilter2dAlgo.setSelectIndexImage( true );
scaleSpaceLogFilter2dAlgo.execute();

std::cout << "outputImage:" << scaleSpaceLogFilter2dAlgo.outputImage()->toString();
std::cout << "scaleTable:" << scaleSpaceLogFilter2dAlgo.scaleTable()->shape();
std::cout << "outputScaleImage:" << scaleSpaceLogFilter2dAlgo.outputScaleImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

scale_space_log_filter_2d_algo = imagedev.ScaleSpaceLogFilter2d()
scale_space_log_filter_2d_algo.input_image = polystyrene
scale_space_log_filter_2d_algo.minimum_standard_deviation = [1.0, 1.0]
scale_space_log_filter_2d_algo.maximum_standard_deviation = [3.0, 3.0]
scale_space_log_filter_2d_algo.number_of_scales = 1
scale_space_log_filter_2d_algo.lightness = imagedev.ScaleSpaceLogFilter2d.BRIGHT
scale_space_log_filter_2d_algo.select_index_image = True
scale_space_log_filter_2d_algo.execute()

print("output_image:", str(scale_space_log_filter_2d_algo.output_image))
print("scale_table:", str(scale_space_log_filter_2d_algo.scale_table))
print("output_scale_image:", str(scale_space_log_filter_2d_algo.output_scale_image))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

ScaleSpaceLogFilter2d scaleSpaceLogFilter2dAlgo = new ScaleSpaceLogFilter2d
{
    inputImage = polystyrene,
    minimumStandardDeviation = new double[]{1.0, 1.0},
    maximumStandardDeviation = new double[]{3.0, 3.0},
    numberOfScales = 1,
    lightness = ScaleSpaceLogFilter2d.Lightness.BRIGHT,
    selectIndexImage = true
};
scaleSpaceLogFilter2dAlgo.Execute();

Console.WriteLine( "outputImage:" + scaleSpaceLogFilter2dAlgo.outputImage.ToString() );
Console.WriteLine( "scaleTable:" + scaleSpaceLogFilter2dAlgo.scaleTable.ToString() );
Console.WriteLine( "outputScaleImage:" + scaleSpaceLogFilter2dAlgo.outputScaleImage.ToString() );

Function Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = scaleSpaceLogFilter2d( polystyrene, {1.0, 1.0}, {3.0, 3.0}, 1, ScaleSpaceLogFilter2d::Lightness::BRIGHT, true );

std::cout << "outputImage:" << result.outputImage->toString();
std::cout << "scaleTable:" << result.scaleTable->shape();
std::cout << "outputScaleImage:" << result.outputScaleImage->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result_output_image, result_scale_table, result_output_scale_image = imagedev.scale_space_log_filter_2d(polystyrene, [1.0, 1.0], [3.0, 3.0], 1, imagedev.ScaleSpaceLogFilter2d.BRIGHT, True)

print("output_image:", str(result_output_image))
print("scale_table:", str(result_scale_table))
print("output_scale_image:", str(result_output_scale_image))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

Processing.ScaleSpaceLogFilter2dOutput result = Processing.ScaleSpaceLogFilter2d( polystyrene, new double[]{1.0, 1.0}, new double[]{3.0, 3.0}, 1, ScaleSpaceLogFilter2d.Lightness.BRIGHT, true );

Console.WriteLine( "outputImage:" + result.outputImage.ToString() );
Console.WriteLine( "scaleTable:" + result.scaleTable.ToString() );
Console.WriteLine( "outputScaleImage:" + result.outputScaleImage.ToString() );