-
Notifications
You must be signed in to change notification settings - Fork 12
Surface fraction
This is the technical specification for the BoneJ2 version of the surface mesh based volume fraction plugin. In BoneJ2 the Volume Fraction tool was split in two tools: voxel and surface mesh based. The split was made because the voxel based version could be generalised to work with any dimensionality whereas the surface based version only works with 3D images. Furthermore most of the settings in the setup dialog are only applicable to the latter. The voxel and surface based methods are now conceptually quite different, and it would be confusing to have them under the same menu entry.
The tool first creates a mask of all the elements in the image that fall within the thresholds. Then it creates a surface from this mask with the marching cubes algorithm. It also creates a surface from the whole image. Finally it calculates the volumes of these surfaces, and the ratio of these volumes.
SurfaceFraction
first creates two surface meshes: one from the foreground elements (value between thresholds) and one from all the elements in the interval. Then it calculates the volumes of these surfaces, and the ratio of the volumes.
- A binary function Op (
RandomAccessibleInterval<T>, Thresholds<T> -> Results
) - T is a generic type
extends NativeType<T> & RealType<T>
-
Results
is an inner helper class of the Op -
Results
contains:Mesh thresholdSurface
,Mesh totalSurface
double thresholdSurfaceVolume
,long totalSurfaceVolume
anddouble ratio
- Uses the
SurfaceMask
op to create a mask for the marching cubes op - Uses the
DefaultMarchingCubes
op to create surface meshes. Results differ from BoneJ1 - Uses the
DefaultVolume
op to calculate the volumes of the surface meshes. - Fails Op matching if
RandomAccessibleInterval
doesn't have three dimensions, becauseDefaultMarchingCubes
requires a RAI like this
Creates a binary mask from elements in the given image within threshold. The mask can be used to create a Mesh
with a marching cubes op.
- A binary function Op (
RandomAccessibleInterval<T>, Thresholds<T> -> Img<BitType>
) - T is a generic type
extends NativeType<T> & RealType<T>
- Fails Op matching if
RandomAccessibleInterval
doesn't have at least three dimensions
A helper class to pass threshold values as one input
- T is a generic type
extends NativeType<T> & RealType<T>
- Contains
T min
andT max
. They are generic so that they are comparable with the elements in the image the thresholds are used with.
- Menu path: Plugins>BoneJ>Fraction>Surface fraction
-
If image is not binary
- Show an error dialog
- Abort the run
-
If no image is open
- Show an error dialog
- Abort the run
-
If has less than three spatial dimensions
- Show an error dialog
- Abort the run
-
If the calibration of the image cannot be determined*
- Show a warning dialog
-
Must not show a warning if the image is uncalibrated (none of the axes have units). No calibration is a valid calibration.
- Only supports binary images
- Results differ, because marching cubes implementation is different
- The results of the Op shall be displayed as "Bone volume" (
thresholdMeshVolume
), "Total volume" (totalMeshVolume
) and "Volume ratio" (volumeRatio
) - The results must be displayed in actual units, i.e. the outputs of the Op must be multiplied by the calibrated size of an element in the input image
- The column headers in the results table must show units (e.g. mm^3)
- If the image is uncalibrated, must not show any unit (e.g. no "pixel" unit)
- Add possibility to limit calculations with the ROI Manager (normal ROIs and irregular ROIs with masks)
- Enable the option to show the surfaces created by the Op (3D Viewer by @kephale)
- 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
- Resampling option (possibly). There's no resampling parameter in the
DefaultMarchingCubes
Op yet- An alternative is to use a smoothing op on the surface
-
Help-button that opens the help page at bonej.org (write the page for the modern version)
- Where to put if there's no setup dialog?
- What to do about extra spatial dimensions? Ignore, or process hyperslices like with channels and frames?