Skip to content

Commit

Permalink
DOC: Fill in missing ITK Filter help text. Improves generated python …
Browse files Browse the repository at this point in the history
…documentation (#707)

* Fill in missing parts of ITK filter documentation
* Fill in missing help text for SurfaceNets filter
* Only generate docs for plugins that were compiled. Reduces print statement noise.

---------

Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson authored Oct 2, 2023
1 parent aa3a843 commit d61e79c
Show file tree
Hide file tree
Showing 38 changed files with 90 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Parameters SurfaceNetsFilter::parameters() const
{
Parameters params;
params.insertSeparator(Parameters::Separator{"Input Parameters"});
params.insertLinkableParameter(std::make_unique<BoolParameter>(k_ApplySmoothing_Key, "Apply smoothing operations", "", false));
params.insertLinkableParameter(std::make_unique<BoolParameter>(k_ApplySmoothing_Key, "Apply smoothing operations", "Use the built in smmothing operation.", false));

params.insertSeparator(Parameters::Separator{"Smoothing Values"});
params.insert(std::make_unique<Int32Parameter>(k_SmoothingIterations_Key, "Relaxation Iterations", "Number of relaxation iterations to perform. More iterations causes more smoothing.", 20));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ https://www.insight-journal.org/browse/publication/217

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |
| BackgroundValue | float64 | Set/Get the background value used to mark the pixels not on the border of the objects. |
| ForegroundValue | float64 | Set/Get the foreground value used to identify the objects in the input and output images. |

Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/ITKImageProcessing/docs/ITKBinaryDilateImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ for arbitrary size and shape". IEEE Transactions on Image Processing. Vol. 9. No
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| BackgroundValue | float64 | |
| ForegroundValue | float64 | |
| BoundaryToForeground | bool | |
| BackgroundValue | float64 | The eroded pixels will receive the BackgroundValue. Default = non positive minimum |
| ForegroundValue | float64 | The pixel value considered 'Foreground' that will be eroded |
| BoundaryToForeground | bool | "Mark the boundary between foreground and background. |

## Required Geometry

Expand Down
6 changes: 3 additions & 3 deletions src/Plugins/ITKImageProcessing/docs/ITKBinaryErodeImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ for arbitrary size and shape". IEEE Transactions on Image Processing. Vol. 9. No
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| BackgroundValue | float64 | |
| ForegroundValue | float64 | |
| BoundaryToForeground | bool | |
| BackgroundValue | float64 | The eroded pixels will receive the BackgroundValue. Default = non positive minimum |
| ForegroundValue | float64 | The pixel value considered 'Foreground' that will be eroded |
| BoundaryToForeground | bool | "Mark the boundary between foreground and background. |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This implementation was taken from the Insight Journal paper: https://www.insigh
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| ForegroundValue | float64 | Set the value in the image to consider as "foreground". Defaults to maximum value of PixelType. |
| BackgroundValue | float64 | Set the value in eroded part of the image. Defaults to zero |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ITKImageStatistics (ImageStatistics)

## Description

Image projection is a very common task in image analysis to reduce the dimension of an image. A base
filter is provided with some specialized filters which implement different projection methods.

This class was contributed to the Insight Journal by Gaetan Lehmann. The original paper can be found at https://www.insight-journal.org/browse/publication/71

### Author
Expand All @@ -29,7 +32,7 @@ This class was contributed to the Insight Journal by Gaetan Lehmann. The origina

| Name | Type | Description |
|------|------|-------------|
| ProjectionDimension | uint32 | |
| ProjectionDimension | uint32 | The index of the projection dimension |
| ForegroundValue | float64 | Set the value in the image to consider as "foreground". Defaults to maximum value of PixelType. Subclasses may alias this to DilateValue or ErodeValue. |
| BackgroundValue | float64 | Set the value used as "background". Any pixel value which is not DilateValue is considered background. BackgroundValue is used for defining boundary conditions. Defaults to NumericTraits<PixelType>::NonpositiveMin() . |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ The filter expect both images to have the same number of dimensions.

The default values for LowerThreshold and UpperThreshold are: LowerThreshold = NumericTraits<TInput>::NonpositiveMin() ; UpperThreshold = NumericTraits<TInput>::max() ; Therefore, generally only one of these needs to be set, depending on whether the user wants to threshold above or below the desired threshold.

Set the thresholds. The default lower threshold is NumericTraits<InputPixelType>::NonpositiveMin() . The default upper threshold is NumericTraits<InputPixelType>::max . An exception is thrown if the lower threshold is greater than the upper threshold.
## Parameters

| Name | Type | Description |
|------|------|-------------|
| LowerThreshold | float64 | |
| UpperThreshold | float64 | Set the thresholds. The default lower threshold is NumericTraits<InputPixelType>::NonpositiveMin() . The default upper threshold is NumericTraits<InputPixelType>::max . An exception is thrown if the lower threshold is greater than the upper threshold. |
| LowerThreshold | float64 | The lower threshold that a pixel value could be and still be considered 'Inside Value' |
| UpperThreshold | float64 | The upper threshold that a pixel value could be and still be considered 'Inside Value'|
| InsideValue | uint8 | Set the "inside" pixel value. The default value NumericTraits<OutputPixelType>::max() |
| OutsideValue | uint8 | Set the "outside" pixel value. The default value NumericTraits<OutputPixelType>::ZeroValue() . |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Applications", Second Edition, Springer, 2003.
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |
| PreserveIntensities | bool | Set/Get whether the original intensities of the image retained for those pixels unaffected by the opening by reconstruction. If Off, the output pixel contrast will be reduced. |

## Required Geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If a pixel's value is equal to the object value and the pixel is adjacent to a n
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| ObjectValue | float64 | |
| ObjectValue | float64 | The pixel value of the 'Object' to be dilated |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If the pixel covered by the center of the kernel has the pixel value ObjectValue
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| ObjectValue | float64 | |
| ObjectValue | float64 | The pixel value of the 'Object' to be eroded |
| BackgroundValue | float64 | Set the value to be assigned to eroded pixels |

## Required Geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Principles and Applications", Second Edition, Springer, 2003.* ReconstructionByE

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Principles and Applications", Second Edition, Springer, 2003.* GrayscaleGeodesic

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/ITKImageProcessing/docs/ITKHConvexImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Principles and Applications", Second Edition, Springer, 2003.* GrayscaleGeodesic
| Name | Type | Description |
|------|------|-------------|
| Height | float64 | Set/Get the height that a local maximum must be above the local background (local contrast) in order to survive the processing. Local maxima below this value are replaced with an estimate of the local background. |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/ITKImageProcessing/docs/ITKHMinimaImage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Principles and Applications", Second Edition, Springer, 2003.* GrayscaleGeodesic
| Name | Type | Description |
|------|------|-------------|
| Height | float64 | Set/Get the height that a local maximum must be above the local background (local contrast) in order to survive the processing. Local maxima below this value are replaced with an estimate of the local background. |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ https://www.insight-journal.org/browse/publication/217

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. *Note* For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |
| BackgroundValue | float64 | Set/Get the background value used to identify the objects and mark the pixels not on the border of the objects. |

## Required Geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This code was contributed in the Insight Journal paper: "The watershed transform

| Name | Type | Description |
|------|------|-------------|
| Level | float64 | |
| Level | float64 | Set the 'level' variable to the filter |
| MarkWatershedLine | bool | Set/Get whether the watershed pixel must be marked or not. Default is true. Set it to false do not only avoid writing watershed pixels, it also decrease algorithm complexity. |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Applications", Second Edition, Springer, 2003.
|------|------|-------------|
| KernelRadius | uint32 | Set the radius of the kernel structuring element. |
| KernelType | KernelEnum | Set the kernel or structuring element used for the morphology. |
| FullyConnected | bool | Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. For objects that are 1 pixel wide, use FullyConnectedOn. |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |
| PreserveIntensities | bool | Set/Get whether the original intensities of the image retained for those pixels unaffected by the opening by reconstruction. If Off, the output pixel contrast will be reduced. |

## Required Geometry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Transforms the image so that any pixel that is not a regional maxima is set to the minimum value for the pixel type. Pixels that are regional maxima retain their value.

The pixel neighborhood is controlled by the FullyConnected attribute. All adjacent pixels are included in
the neighborhood when FullyConnected=True and the diagonally adjacent pixels are not included when
FullyConnected=False. Different terminology is often used to describe neighborhoods – one common ex-
ample is the “connectivity” notation, which refers to the number of pixels in the neighborhood. FullyCon-
nected=False corresponds to a connectivty of 4 in 2D and 6 in 3D, while FullyConnected=True corresponds
to a connectivity of 8 in 2D and 26 in 3D. FullyConnected=False is also commonly referred to as “face
connected”.

## Group (Subgroup)

ITKMathematicalMorphology (MathematicalMorphology)
Expand All @@ -26,7 +34,7 @@ This code was contributed in the Insight Journal paper: "Finding regional extrem

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This code was contributed in the Insight Journal paper: "Finding regional extrem

| Name | Type | Description |
|------|------|-------------|
| FullyConnected | bool | |
| FullyConnected | bool | Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False |

## Required Geometry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ Parameters ITKBinaryContourImage::parameters() const
{
Parameters params;
params.insertSeparator(Parameters::Separator{"Input Parameters"});
params.insert(std::make_unique<BoolParameter>(k_FullyConnected_Key, "FullyConnected",
"Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. "
"For objects that are 1 pixel wide, use FullyConnectedOn.",
params.insert(std::make_unique<BoolParameter>(k_FullyConnected_Key, "Fully Connected Components",
"Whether the connected components are defined strictly by face connectivity (False) or by face+edge+vertex connectivity (True). Default is False"
"For objects that are 1 pixel wide, use True.",
false));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "BackgroundValue", "Set/Get the background value used to mark the pixels not on the border of the objects.", 0.0));
params.insert(std::make_unique<Float64Parameter>(k_ForegroundValue_Key, "ForegroundValue", "Set/Get the foreground value used to identify the objects in the input and output images.", 1.0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Parameters ITKBinaryDilateImage::parameters() const
std::vector<std::string>{"X", "Y", "Z"}));
params.insert(std::make_unique<ChoicesParameter>(k_KernelType_Key, "KernelType", "The shape of the kernel to use. 0=Annulas, 1=Ball, 2=Box, 3=Cross", static_cast<uint64>(itk::simple::sitkBall),
ChoicesParameter::Choices{"Annulus", "Ball", "Box", "Cross"}));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "BackgroundValue", "The background value of the image", 0.0));
params.insert(std::make_unique<Float64Parameter>(k_ForegroundValue_Key, "ForegroundValue", "The foreground value of the image", 1.0));
params.insert(std::make_unique<BoolParameter>(k_BoundaryToForeground_Key, "BoundaryToForeground", "", false));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "BackgroundValue", "The eroded pixels will receive the BackgroundValue. Default = non positive minimum", 0.0));
params.insert(std::make_unique<Float64Parameter>(k_ForegroundValue_Key, "ForegroundValue", "The pixel value considered 'Foreground' that will be eroded ", 1.0));
params.insert(std::make_unique<BoolParameter>(k_BoundaryToForeground_Key, "BoundaryToForeground", "Mark the boundary between foreground and background.", false));

params.insertSeparator(Parameters::Separator{"Required Input Cell Data"});
params.insert(std::make_unique<GeometrySelectionParameter>(k_SelectedImageGeomPath_Key, "Image Geometry", "Select the Image Geometry Group from the DataStructure.", DataPath({"Image Geometry"}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ Parameters ITKBinaryErodeImage::parameters() const
std::vector<std::string>{"X", "Y", "Z"}));
params.insert(std::make_unique<ChoicesParameter>(k_KernelType_Key, "KernelType", "The shape of the kernel to use. 0=Annulas, 1=Ball, 2=Box, 3=Cross", static_cast<uint64>(itk::simple::sitkBall),
ChoicesParameter::Choices{"Annulus", "Ball", "Box", "Cross"}));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "BackgroundValue", "The background value of the image", 0.0));
params.insert(std::make_unique<Float64Parameter>(k_ForegroundValue_Key, "ForegroundValue", "The foreground value of the image", 1.0));
params.insert(std::make_unique<BoolParameter>(k_BoundaryToForeground_Key, "BoundaryToForeground", "", true));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "BackgroundValue", "The eroded pixels will receive the BackgroundValue. Default = non positive minimum", 0.0));
params.insert(std::make_unique<Float64Parameter>(k_ForegroundValue_Key, "ForegroundValue", "The pixel value considered 'Foreground' that will be eroded ", 1.0));
params.insert(std::make_unique<BoolParameter>(k_BoundaryToForeground_Key, "BoundaryToForeground", "Mark the boundary between foreground and background.", true));

params.insertSeparator(Parameters::Separator{"Required Input Cell Data"});
params.insert(std::make_unique<GeometrySelectionParameter>(k_SelectedImageGeomPath_Key, "Image Geometry", "Select the Image Geometry Group from the DataStructure.", DataPath({"Image Geometry"}),
Expand Down
Loading

0 comments on commit d61e79c

Please sign in to comment.