Skip to content

Element fraction

Richard Domander edited this page Nov 15, 2016 · 11 revisions

In BoneJ1 the volume fraction plugin offered methods of calculating : voxels and surface mesh. In BoneJ2 the voxel based version was generalised to work in any dimensionality, so the plugin was split into two tools. The surface based version only works with 3D images, and it would be quite confusing to have them under one menu. Because the voxel tool now works with any dimensionality, it's called element fraction instead of volume fraction.

Element fraction calculates the fraction of a bone in a sample by comparing the number of elements in a set E to the total number of image elements in the sample. All the elements in set E have values between certain predetermined thresholds. These thresholds should be optimised so that set E only contains elements which correspond to bone in the original image. At the moment the tool only supports binary images, so E should consist of all the foreground elements. If the image is 3D then the plugin calculates the fraction of bone volume of the total sample volume. If it's 2D, it calculates fraction of bone area etc.

ElementFractionWrapper

  • Menu path: Plugins>BoneJ>Fraction>Area/Volume fraction
  • Inputs
    • ImgPlus<T> inputImage (T extends RealType<T> & NativeType<T>)
  • Outputs
    • None
Setup dialog
  • No setup dialog
Messages
  • If no image is open
    • show an error message
    • abort the run
  • If image is not binary
    • show an error message
    • abort the run
  • If image has less than two or more than three spatial dimensions
    • show an error message
    • abort the run
  • If the calibration of the image cannot be determined*
    • Show a warning dialog

*Calibration is unknown if spatial axes have no units, have incompatible units, or are not linear

Results
  • The results of the Op shall be displayed as "Bone volume", "Total volume" (elements) and "Volume ratio" (ratio). These will be "area" if the image is 2D.
  • The results must be calibrated, i.e. the outputs of the Op must be multiplied by the size of an element in the input image
  • The column headers in the results table must show units
  • The superscript of the units must be the same as the spatial dimensionality of the input image, i.e. mm^2 if processing a 2D image
  • If the image is uncalibrated, must not show any unit (e.g. no "pixel" unit)
Differences from BoneJ1
  • Can also handle 2D images and hyper stacks
  • Accepts only binary images

ElementFraction Op

This op is redundant and will be removed

Counts the number of elements between the thresholds and the total number of elements. Then it calculates the fraction (foregroundElements / totalElements).

  • Location org.bonej.ops
  • A binary function Op (IterableInterval<T>, Settings<S> -> Results)
  • S and T are generic types where T extends Comparable<S>
  • Settings and Results are inner helper classes of the ElementFraction
  • Settings contains: S minThreshold and S maxThreshold
  • Results contains: long thresholdElements, long elements and double ratio

Future developments

  • Add possibility to limit calculations with the ROI Manager (normal ROIs and irregular ROIs with masks)
  • Solve issues with determining thresholds from the input image
  • Thresholds
    • Do fancy GUI, or limit wrapper to binary images, and prerequire thresholding?
    • Setup dialog for threshold values (values depend on image type)
    • Enable support for all greyscale images? How to check if an image is greyscale?
    • Change widgets based on image type, i.e. decimal numbers if we have a floating point image
  • Help-button that opens the help page at bonej.org (write the page for the modern version)
    • If no dialog, where to put Help-button?
  • Usage reporter
  • BoneJ2 user documentation
  • How to handle images with weird number of spatial dimensions? (<2 or >3)
  • Drop ElementFraction op and use existing thresholding code from imagej-ops
  • Make the results output @Parameters
Clone this wiki locally