Skip to content

ThicknessWrapper

Michael Doube edited this page May 29, 2019 · 19 revisions

This page documents the wrapper class of the LocalThickness_ plugin in BoneJ. The plugin is used through a wrapper instead of called directly to:

  1. Place it under the Plugins>BoneJ menu entry
  2. Additional validation of inputs
  3. More information shown to the user
  4. Modern API wrapping for a legacy plug-in
  5. Easier to call another implementation, if and when an Op based version of LocalThickness_ is implemented.

The wrapper will call the LocalThickness_ plugin even though it still is very much in the ImageJ1 world. In the ideal case we would have the time to convert the plugin into an Op (or rather each step into an individual Op). The original developer has withdrawn from maintaining the plugin.

LocalThickness calculates the local thickness values of a binary 3D image. More specifically it determines "the diameter of the largest sphere that fits inside the object and contains the point” for each point i.e. foreground voxel in the image. The LocalThickness plugin consists of several processing steps. The wrapper calls them all in succession. In BoneJ it's assumed that the tool is used for analysing the thickness of trabecular bone samples. Thus foreground voxels correspond to bone and background to the space between the trabeculae.

ThicknessWrapper

  • Menu path: Plugins>BoneJ>Thickness
  • Input
    • ImagePlus inputImage
    • String mapChoice
    • boolean showMaps
    • boolean maskArtefacts
    • boolean cropToRois
  • Output
    • Table<DefaultColumn<String>, String> resultsTable
    • ImagePlus trabecularMap
    • ImagePlus spacingMap
  • Calls
    • LocalThicknessWrapper in sc.fiji.LocalThickness_
Setup dialog
  • Options
    • String mapChoice
      • Label: Calculate:
      • Description: Which thickness measures to calculate
      • Widget: Vertical radio button group. Choices: "Trabecular thickness", "Trabecular spacing", "Both"
    • boolean showMaps
      • Label: Show thickness maps
      • Description: Show resulting map images after calculations
      • Widget: Check-box
      • Optional (required = false)
    • boolean maskArtefacts
      • Label: Mask thickness maps
      • Tooltip: Remove pixel artifacts from the thickness maps
      • Widget: Check-box
      • Optional (required = false, persist = false)
Messages
  • If there is no input image
    • Show an error dialog
    • Abort the run
  • If the input image is not 8-bit binary colour
    • Show an error dialog
    • Abort the run
  • If the input image does not have three spatial dimensions
    • Show an error dialog
    • Abort the run
  • If the input image is composite
    • Show an error dialog
    • Abort the run
  • If the input image has a time dimension
    • Show an error dialog
    • Abort the run
  • If the input image does not have isotropic calibration
    • Show a warning dialog with the degree of anisotropy
    • Continue if user clicks OK
Results
  • Shows Mean value (Mean), Standard deviation (Std Dev) and Maximum value (Max) for trabecular thickness and/or spacing in Shared table
    • Add a prefix to each column header: Tb.Th for thickness and Tb.Sp for spacing
    • Shows unit of calibration for the results, e.g. mm^3
  • Displays the local thickness map and/or trabecular spacing map
    • The pixel values in the output images are calibrated (thickness in real units)
    • Zero pixels are marked NaN instead
    • The title of the output image is either "<title of input image>_Tb.Th" or "<title of input image>_Tb.Sp"
Differences from BoneJ1
  • Settings persist except for maskArtefacts
  • LocalThickness is included via Maven instead of packaging it in org.bonej.*