PartSegCore.analysis.measurement_calculation

class PartSegCore.analysis.measurement_calculation.ColocalizationMeasurement[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • channel_fst (Channel)- Channel 1

  • channel_scd (Channel)- Channel 2

  • colocalization (CorrelationEnum)- Colocalization

  • randomize (bool)- Randomize channel, If randomize orders of pixels in one channel

  • randomize_repeat (int)- Randomize num, Number of repetitions for mean_calculate

classmethod calculate_property(area_array, colocalization, randomize=False, randomize_repeat=10, channel_fst=0, channel_scd=1, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

Return type

symbols

class PartSegCore.analysis.measurement_calculation.Compactness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(**kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.ComponentBoundingBox[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(bounds_info, _component_num, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.ComponentsInfo(roi_components: numpy.ndarray, mask_components: numpy.ndarray, components_translation: Dict[int, List[int]])[source]

Bases: NamedTuple

Class for storage information about relation between roi components and mask components

Variables
  • roi_components (numpy.ndarray) – list of roi components

  • mask_components (numpy.ndarray) – list of mask components

  • components_translation (Dict[int, List[int]]) – mapping from roi components to mask components base on intersections

components_translation: Dict[int, List[int]]

Alias for field number 2

mask_components: numpy.ndarray

Alias for field number 1

roi_components: numpy.ndarray

Alias for field number 0

class PartSegCore.analysis.measurement_calculation.ComponentsNumber[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.CorrelationEnum(value)[source]

Bases: str, enum.Enum

An enumeration.

class PartSegCore.analysis.measurement_calculation.Diameter[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

Class for calculate diameter of ROI in fast way. From Malandain, G., & Boissonnat, J. (2002). Computing the diameter of a point set, 12(6), 489-509. https://doi.org/10.1142/S0218195902001006

static calculate_property(area_array, voxel_size, result_scalar, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.DiameterOld[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

n**2 calculate diameter of ROI

static calculate_property(area_array, voxel_size, result_scalar, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.DistanceMaskROI[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • distance_from_mask (DistancePoint)- Distance from mask

  • distance_to_roi (DistancePoint)- Distance to ROI

static area_type(area)[source]

Map chosen area type to proper area type. Allow to correct Area type.

classmethod calculate_property(channel, area_array, mask, voxel_size, result_scalar, distance_from_mask, distance_to_roi, *args, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.DistancePoint(value)[source]

Bases: enum.Enum

An enumeration.

class PartSegCore.analysis.measurement_calculation.DistanceROIROI[source]

Bases: PartSegCore.analysis.measurement_calculation.DistanceMaskROI

This algorithm has following parameters:

  • profile (ROIExtractionProfile)- ROI extraction profile

  • distance_from_new_roi (DistancePoint)- Distance new ROI

  • distance_to_roi (DistancePoint)- Distance to ROI

classmethod calculate_property(channel, image, area_array, profile, mask, voxel_size, result_scalar, distance_from_new_roi, distance_to_roi, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel (ndarray) – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array (ndarray) – array representing current area returned by area_type()

  • roi – array representing roi

  • mask (Optional[ndarray]) – array representing mask (upper level roi)

  • voxel_size (Sequence[float]) – size of single voxel in meters

  • result_scalar (float) – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

class PartSegCore.analysis.measurement_calculation.FirstPrincipalAxisLength[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(**kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.GetROIAnnotationType[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • name (str)- Name

static calculate_property(roi_annotation, name, _component_num, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.Haralick[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • feature (HaralickEnum)- Feature

  • distance (ConstrainedIntValue)- Distance

classmethod calculate_property(area_array, channel, distance, feature, _cache=False, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

Return type

symbols

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.HaralickEnum(value)[source]

Bases: enum.Enum

An enumeration.

PartSegCore.analysis.measurement_calculation.MEASUREMENT_DICT

Register with all measurements algorithms

Need class methods: get_description, is_component, calculate_property, get_starting_leaf, get_units, need_channel

Default content:

class PartSegCore.analysis.measurement_calculation.MaximumPixelBrightness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.MeanPixelBrightness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.MeasurementResult(components_info)[source]

Bases: MutableMapping[str, Tuple[Union[float, List[float], str], str]]

Class for storage measurements info.

get_component_info(all_components=False)[source]

Get information which type of components are in storage.

Return type

Tuple[bool, bool]

Returns

has_mask_components, has_segmentation_components

get_global_names()[source]

Get names for only parameters which are not ‘PerComponent.Yes’

get_global_parameters()[source]

Get only parameters which are not ‘PerComponent.Yes’

get_labels(expand=True, all_components=False)[source]

If expand is false return list of keys of this storage. Otherwise return labels for measurement. Base are keys of this storage. If has mask components, or has segmentation_components then add this labels

Return type

List[str]

get_separated(all_components=False)[source]

Get measurements separated for each component

Return type

List[List[Union[float, List[float], str]]]

set_filename(path_fo_file)[source]

Set name of file to be presented as first position.

class PartSegCore.analysis.measurement_calculation.MedianPixelBrightness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.MinimumPixelBrightness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.Moment[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, voxel_size, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.PixelBrightnessSum[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]
Parameters
  • area_array (ndarray) – mask for area

  • channel (ndarray) – data. same shape like area_type

Returns

Pixels brightness sum on given area

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

exception PartSegCore.analysis.measurement_calculation.ProhibitedDivision[source]

Bases: Exception

class PartSegCore.analysis.measurement_calculation.ROINeighbourhoodROI[source]

Bases: PartSegCore.analysis.measurement_calculation.DistanceMaskROI

This algorithm has following parameters:

  • profile (ROIExtractionProfile)- ROI extraction profile

  • distance (ConstrainedFloatValue)- Distance

  • units (Units)- Units

classmethod calculate_property(image, area_array, profile, mask, voxel_size, distance, units, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array (ndarray) – array representing current area returned by area_type()

  • roi – array representing roi

  • mask (Optional[ndarray]) – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

class PartSegCore.analysis.measurement_calculation.RimPixelBrightnessSum[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • distance (ConstrainedFloatValue)- Distance

  • units (Units)- Units

static area_type(area)[source]

Map chosen area type to proper area type. Allow to correct Area type.

static calculate_property(channel, area_array, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.RimVolume[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • distance (ConstrainedFloatValue)- Distance

  • units (Units)- Units

static area_type(area)[source]

Map chosen area type to proper area type. Allow to correct Area type.

static calculate_property(area_array, voxel_size, result_scalar, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.SecondPrincipalAxisLength[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(**kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.SettingsValue(function, help_message, arguments, is_component, default_area)[source]

Bases: NamedTuple

arguments: Optional[dict]

Alias for field number 2

default_area: Optional[PartSegCore.analysis.measurement_base.AreaType]

Alias for field number 4

function: Callable

Alias for field number 0

help_message: str

Alias for field number 1

is_component: bool

Alias for field number 3

class PartSegCore.analysis.measurement_calculation.Sphericity[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(**kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.SplitOnPartPixelBrightnessSum[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • num_of_parts (ConstrainedIntValue)- Number of Parts

  • equal_volume (bool)- Equal Volume, If split should be done in respect of parts volume of parts thickness.

  • part_selection (ConstrainedIntValue)- Which part (from border)

static area_type(area)[source]

Map chosen area type to proper area type. Allow to correct Area type.

static calculate_property(part_selection, channel, area_array, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.SplitOnPartVolume[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

This algorithm has following parameters:

  • num_of_parts (ConstrainedIntValue)- Number of Parts

  • equal_volume (bool)- Equal Volume, If split should be done in respect of parts volume of parts thickness.

  • part_selection (ConstrainedIntValue)- Which part (from border)

static area_type(area)[source]

Map chosen area type to proper area type. Allow to correct Area type.

static calculate_property(part_selection, area_array, voxel_size, result_scalar, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_starting_leaf()[source]

This leaf is put on default list

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.StandardDeviationOfPixelBrightness[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, channel, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.Surface[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(area_array, voxel_size, result_scalar, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.ThirdPrincipalAxisLength[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

static calculate_property(**kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

classmethod need_channel()[source]

if need image data

class PartSegCore.analysis.measurement_calculation.Volume[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

classmethod calculate_property(area_array, voxel_size, result_scalar, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

class PartSegCore.analysis.measurement_calculation.VoxelSize[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

classmethod calculate_property(voxel_size, result_scalar, **kwargs)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

Return type

symbols

class PartSegCore.analysis.measurement_calculation.Voxels[source]

Bases: PartSegCore.analysis.measurement_base.MeasurementMethodBase

classmethod calculate_property(area_array, **_)[source]

Main function for calculating measurement

Parameters
  • channel – main channel selected for measurement

  • channel_{i} – for channel requested using get_fields() AlgorithmProperty("channel", "Channel", 0, value_type=Channel)

  • area_array – array representing current area returned by area_type()

  • roi – array representing roi

  • mask – array representing mask (upper level roi)

  • voxel_size – size of single voxel in meters

  • result_scalar – scalar to get proper units in result

  • roi_alternative – dict with alternative roi representation (for plugin specific mapping)

  • roi_annotation – dict with roi annotations (for plugin specific mapping)

List incomplete.

classmethod get_units(ndim)[source]

Return units for measurement. They are shown to user

PartSegCore.analysis.measurement_calculation.double_normal(point_index, point_positions, points_array)[source]
Parameters
  • point_index (int) – index of starting points

  • point_positions (ndarray) – points array of size (points_num, number of dimensions)

  • points_array (ndarray) – bool matrix with information about which points are in set

Returns

PartSegCore.analysis.measurement_calculation.empty_fun(_a0=None, _a1=None)[source]

This function is being used as dummy reporting function.

PartSegCore.analysis.measurement_calculation.hash_fun_call_name(fun, arguments, area, per_component, channel, components_num)[source]

Calculate string for properly cache measurements result.

Parameters
Return type

str

Returns

unique string for such set of arguments

PartSegCore.analysis.measurement_calculation.iterative_double_normal(points_positions)[source]
Parameters

points_positions (ndarray) – points array of size (points_num, number of dimensions)

Returns

square power of diameter, 2-tuple of points index gave information which points ar chosen