OrsBoneAnalysis_39881c9e6f4311e88d25448a5b5d70c0

Tools to analyze bone datasets and segmentations.

The segmentation algorithms are taken from: - Buie et al., Bone, vol. 41, p.505-515, 2007. - Kohler et al., Bone, vol. 41, p.659-667, 2007.

author:ORS Team
contact:http://theobjects.com
email:info@theobjects.com
organization:Object Research Systems (ORS), Inc.
address:760 St-Paul West, suite 101, Montréal, Québec, Canada, H3C 1M4
copyright:Object Research Systems (ORS), Inc. All rights reserved 2018.
date:Jun 13 2018 15:51
dragonflyVersion:
 3.6.0.470 (D)
UUID:39881c9e6f4311e88d25448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsBoneAnalysis_39881c9e6f4311e88d25448a5b5d70c0.OrsBoneAnalysis_39881c9e6f4311e88d25448a5b5d70c0.OrsBoneAnalysis_39881c9e6f4311e88d25448a5b5d70c0(varname=None, managed=True)
MAPPING_ALGORITHM_MIL = 'MIL'
MAPPING_ALGORITHM_SURFACENORMALS = 'Surface normals'
MAPPING_ALGORITHM_VOLUMEFRACTION = 'Volume fraction'
OrsBoneAnalysis_39881c9e6f4311e88d25448a5b5d70c0_openGUI()

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

SEGMENTATION_ALGORITHM_BUIE = 'Buie'
SEGMENTATION_ALGORITHM_KOHLER = 'Kohler'
SEGMENTATION_ALGORITHM_KOHLER_LABEL_CORTICAL = 0
SEGMENTATION_ALGORITHM_KOHLER_LABEL_TRABECULAE = 1
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
canComputeMeasurements()
closable = True
closeWidget(name)
computeAnisotropyMappingFromMIL(aROI, areaOfAnalysisBox, areaOfAnalysisSpacing, useSingleVoxelInDirectionWithSmallerBoxLength, lengthToAnalyze, samplingDistance, countOrientations)

Computes a map of the anisotropy of a ROI using the mean intercept length (MIL)

Parameters:
  • aROI (ORSModel.ors.ROI) – bone segmentation
  • areaOfAnalysisBox (ORSModel.ors.VisualBox) – visual box to use
  • areaOfAnalysisSpacing (float) – distance between the points in the analysis area
  • useSingleVoxelInDirectionWithSmallerBoxLength (bool) – if True, a single voxel will be used in the direction having the smaller length; otherwise, the same spacing will be used in that direction.
  • lengthToAnalyze (float) – the distance to analyze per orientation per star
  • samplingDistance (float) – the distance between each sample on the line of analysis
  • countOrientations (int) – the count of lines to analyze per star
Returns:
computeAnisotropyMappingFromSurfaceNormalsOnMesh(aMesh, areaOfAnalysisBox, areaOfAnalysisSpacing, useSingleVoxelInDirectionWithSmallerBoxLength, radiusOfInfluence, mappingsUseProjectionBasedAnisotropyComputation)

Computes a map of the anisotropy of a mesh using the surface normals

Parameters:
  • aMesh (ORSModel.ors.Mesh) – a bone contour
  • areaOfAnalysisBox (ORSModel.ors.VisualBox) – visual box to use
  • areaOfAnalysisSpacing (float) – distance between the points in the analysis area
  • useSingleVoxelInDirectionWithSmallerBoxLength (bool) – if True, a single voxel will be used in the direction having the smaller length; otherwise, the same spacing will be used in that direction.
  • radiusOfInfluence (float) – distance from the analysis point to the last considered anisotropy element
  • mappingsUseProjectionBasedAnisotropyComputation (bool) – anisotropy computation method. If True, the projection based method is used; if False, the eigenvalues from the tensor of inertia are taken.
Returns:
computeAnisotropyMappingFromSurfaceNormalsOnROI(aROI, areaOfAnalysisBox, areaOfAnalysisSpacing, useSingleVoxelInDirectionWithSmallerBoxLength, radiusOfInfluence, mappingsUseProjectionBasedAnisotropyComputation, meshSmoothingRepetitions)

Computes a map of the anisotropy of a ROI using the surface normals

Parameters:
  • aROI (ORSModel.ors.ROI) – bone segmentation
  • areaOfAnalysisBox (ORSModel.ors.VisualBox) – visual box to use
  • areaOfAnalysisSpacing (float) – distance between the points in the analysis area
  • useSingleVoxelInDirectionWithSmallerBoxLength (bool) – if True, a single voxel will be used in the direction having the smaller length; otherwise, the same spacing will be used in that direction.
  • radiusOfInfluence (float) – distance from the analysis point to the last considered anisotropy element
  • mappingsUseProjectionBasedAnisotropyComputation (bool) – anisotropy computation method. If True, the projection based method is used; if False, the eigenvalues from the tensor of inertia are taken.
  • meshSmoothingRepetitions (int) – number of times the mesh obtained from the ROI should be smoothed before computing the anisotropy
Returns:
computeMappingsAnisotropy()
computeMeasurements()
computeVolumeFractionMapping(aROI, areaOfAnalysisBox, areaOfAnalysisSpacing, useSingleVoxelInDirectionWithSmallerBoxLength, radius)

Computes a map of the volume fraction of a ROI

Parameters:
  • aROI (ORSModel.ors.ROI) – bone segmentation
  • areaOfAnalysisBox (ORSModel.ors.VisualBox) – visual box to use
  • areaOfAnalysisSpacing (float) – distance between the points in the analysis area
  • useSingleVoxelInDirectionWithSmallerBoxLength (bool) – if True, a single voxel will be used in the direction having the smaller length; otherwise, the same spacing will be used in that direction.
  • radius (float) – the distance from the analysis point to the last considered ROI element
Returns:

channelVolumeFractionMapping (ORSModel.ors.Channel) – map of volume fraction

deletePlugin(aWidget=None)
deleteWorkingObjectsKohlerMethod()
exportCorticalTrabecularMeasurementsToCSV(filename)
getAnisotropyMILMaxIterations()
getAnisotropyMILMinIterations()
getAnisotropyMILOrientations()
getAnisotropyMILRadius()
getAnisotropyMILSampling()
getAnisotropyMILTolerance()
getAnisotropySVDMaxIterations()
getAnisotropySVDMinIterations()
getAnisotropySVDOrientations()
getAnisotropySVDRadius()
getAnisotropySVDSampling()
getAnisotropySVDTolerance()
getCorticalTrabecularMeasurementsBoneROI()
getCorticalTrabecularMeasurementsCorticalAreaROI()
getCorticalTrabecularMeasurementsTrabecularAreaROI()
getMappingsAlgorithm()
getMappingsMILOrientations()
getMappingsMILRadius()
getMappingsMILSampling()
getMappingsMeshSmoothingRepetitions()
getMappingsROI()
getMappingsRadiusOfInfluence()
getMappingsSpacing()
getMappingsUseProjectionBasedAnisotropyComputation()
getMappingsUseSingleVoxelInDirectionWithSmallerBoxLength()
getMappingsVisualBox()
getMappingsVolumeFractionRadius()
getMultiROIDisconnectedIsosurfaces()
getSegmentCorticalTrabecularAreasKohlerWorkingObjects()
getSegmentationCorticalTrabecularAreasAlgorithm()
getSegmentationCorticalTrabecularThresholdDistanceCloseHoles()
getSegmentationCorticalTrabecularTrabecularThickness()
getTableCorticalTrabecularMeasurements()
keepAlive = False
multiple = False
classmethod openGUI()
openWidget(name, dock=None, tab=None, x=-1, y=-1, w=-1, l=-1, order=-1)
refreshAfterPreferencesChanged()
refreshDataTableCorticalTrabecularMeasurements()
savable = False
segmentCorticalTrabecularAreas()
segmentCorticalTrabecularAreasBuie(boneROI, thresholdDistanceCloseHoles, trabecularThickness, aProgress)

Segments the cortical and trabecular areas and the cortical and trabecular bone of a bone segmentation.

Parameters:
  • boneROI (ORSModel.ors.ROI) – bone segmentation (where the bone mineralization is present)
  • thresholdDistanceCloseHoles (float) – threshold distance to close the holes of the full bone
  • trabecularThickness (float) – threshold distance to close the holes of the trabecular area
  • aProgress (ORSModel.ors.Progress) – progress object
Returns:
  • corticalArea (ORSModel.ors.ROI) – cortical area. It is the segmentation of the filled area corresponding to the bone cortex.
  • trabecularArea (ORSModel.ors.ROI) – trabecular area. It is the segmentation of the filled area corresponding to the bone marrow.
  • corticalBone (ORSModel.ors.ROI) – cortical bone. It is the intersection of the cortical area with the provided bone segmentation.
  • trabecularBone (ORSModel.ors.ROI) – trabecular bone. It is the intersection of the trabecular area with the provided bone segmentation.

Note

Based on the algorithm of Buie et al., Bone, vol. 41, p.505-515, 2007.

segmentCorticalTrabecularAreasKohlerStep1(boneROI, thresholdDistanceCloseHoles, aProgress)

Segments the cortical and trabecular areas and the cortical and trabecular bone of a bone segmentation.

This is the first of 2 steps, where a multiROI of isosurfaces is produced. The segmentation in cortical and trabecular areas and in cortical and trabecular bone will be done in the second step, where a threshold of volume per isosurface should be provided.

Parameters:
  • boneROI (ORSModel.ors.ROI) – bone segmentation (where the bone mineralization is present)
  • thresholdDistanceCloseHoles (float) – threshold distance to close the holes of the full bone
  • aProgress (ORSModel.ors.Progress) – progress object
Returns:

aSegmentCorticalTrabecularAreasKohlerWorkingObjects (undefined) – object keeping the information about temporary instances required to perform the second step of the Kohler method. It is an instance of SegmentCorticalTrabecularAreasKohlerWorkingObjects, but should not be constructed manually.

Note

Based on the algorithm of Kohler et al., Bone, vol. 41, p.659-667, 2007.

segmentCorticalTrabecularAreasKohlerStep2(aSegmentCorticalTrabecularAreasKohlerWorkingObjects, thresholdMaxVolumeTrabecularIsosurface, aProgress)

Segments the cortical and trabecular areas and the cortical and trabecular bone of a bone segmentation.

This is the second of 2 steps, where the segmentation in cortical and trabecular areas and in cortical and trabecular bone is obtained from the multiROI of isosurfaces produced at the first step and a threshold of volume per isosurface should be provided.

The working objects are deleted at the end of this method.

Parameters:
  • aSegmentCorticalTrabecularAreasKohlerWorkingObjects (undefined) – object keeping the information about temporary instances required to perform the second step of the Kohler method. It is an instance of SegmentCorticalTrabecularAreasKohlerWorkingObjects, but should not be constructed manually, but rather be obtained from the first step.
  • thresholdMaxVolumeTrabecularIsosurface (float) – maximal volume (in m^3) of the isosurface to be considered as trabeculae
  • aProgress (ORSModel.ors.Progress) – progress object
Returns:
  • corticalArea (ORSModel.ors.ROI) – cortical area. It is the segmentation of the filled area corresponding to the bone cortex.
  • trabecularArea (ORSModel.ors.ROI) – trabecular area. It is the segmentation of the filled area corresponding to the bone marrow.
  • corticalBone (ORSModel.ors.ROI) – cortical bone. It is the intersection of the cortical area with the provided bone segmentation.
  • trabecularBone (ORSModel.ors.ROI) – trabecular bone. It is the intersection of the trabecular area with the provided bone segmentation.

Note

Based on the algorithm of Kohler et al., Bone, vol. 41, p.659-667, 2007.

segmentCorticalTrabecularAreasKohlerStep2Cancelling(aSegmentCorticalTrabecularAreasKohlerWorkingObjects)

Deletes the working objects used in the Kohler method of segmentation of the cortical and trabecular areas and the cortical and trabecular bone of a bone segmentation.

Parameters:aSegmentCorticalTrabecularAreasKohlerWorkingObjects (undefined) – object keeping the information about temporary instances required to perform the second step of the Kohler method. It is an instance of SegmentCorticalTrabecularAreasKohlerWorkingObjects, but should not be constructed manually, but rather be obtained from the first step.

Note

Based on the algorithm of Kohler et al., Bone, vol. 41, p.659-667, 2007.

segmentCorticalTrabecularAreasKohlerStep2CancellingImplementation()
segmentCorticalTrabecularAreasKohlerStep2Implementation(volumeThreshold)
setAnisotropyMILMaxIterations(anisotropyMILMaxIterations)
setAnisotropyMILMinIterations(anisotropyMILMinIterations)
setAnisotropyMILOrientations(anisotropyMILOrientations)
setAnisotropyMILRadius(anisotropyMILRadius)
setAnisotropyMILSampling(anisotropyMILSampling)
setAnisotropyMILTolerance(anisotropyMILTolerance)
setAnisotropySVDMaxIterations(anisotropySVDMaxIterations)
setAnisotropySVDMinIterations(anisotropySVDMinIterations)
setAnisotropySVDOrientations(anisotropySVDOrientations)
setAnisotropySVDRadius(anisotropySVDRadius)
setAnisotropySVDSampling(anisotropySVDSampling)
setAnisotropySVDTolerance(anisotropySVDTolerance)
setCorticalTrabecularMeasurementsBoneROI(corticalTrabecularMeasurementsBoneROI)
setCorticalTrabecularMeasurementsCorticalAreaROI(corticalTrabecularMeasurementsCorticalAreaROI)
setCorticalTrabecularMeasurementsTrabecularAreaROI(corticalTrabecularMeasurementsTrabecularAreaROI)
setMappingsAlgorithm(mappingsAlgorithm)
setMappingsMILOrientations(mappingsMILOrientations)
setMappingsMILRadius(mappingsMILRadius)
setMappingsMILSampling(mappingsMILSampling)
setMappingsMeshSmoothingRepetitions(mappingsMeshSmoothingRepetitions)
setMappingsROI(mappingsROI)
setMappingsRadiusOfInfluence(mappingsRadiusOfInfluence)
setMappingsSpacing(mappingsSpacing)
setMappingsUseProjectionBasedAnisotropyComputation(mappingsUseProjectionBasedAnisotropyComputation)
setMappingsUseSingleVoxelInDirectionWithSmallerBoxLength(mappingsUseSingleVoxelInDirectionWithSmallerBoxLength)
setMappingsVisualBox(mappingsVisualBox)
setMappingsVolumeFractionRadius(mappingsVolumeFractionRadius)
setSegmentationCorticalTrabecularAreasAlgorithm(segmentationCorticalTrabecularAreasAlgorithm)
setSegmentationCorticalTrabecularThresholdDistanceCloseHoles(segmentationCorticalTrabecularThresholdDistanceCloseHoles)
setSegmentationCorticalTrabecularTrabecularThickness(segmentationCorticalTrabecularTrabecularThickness)
showInToolbar = True
toolsMenu()

classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:

class C:

@classmethod def f(cls, arg1, arg2, …):

It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.

Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.

classmethod updateColorsMultiROIDisconnectedIsosurfaces(aMultiROIDisconnectedIsosurfaces, npLabelsVolumeInMeterCube, thresholdMaxVolumeTrabecularIsosurface=0, alphaValue=0.5)
updateColorsMultiROIDisconnectedIsosurfacesImplementation(thresholdMaxVolumeTrabecularIsosurface)