opengate.actors.dataitems ========================= .. py:module:: opengate.actors.dataitems Attributes ---------- .. autoapisummary:: opengate.actors.dataitems.available_data_container_classes Classes ------- .. autoapisummary:: opengate.actors.dataitems.DataItem opengate.actors.dataitems.MeanValueDataItemMixin opengate.actors.dataitems.ArithmeticDataItem opengate.actors.dataitems.ArrayDataItem opengate.actors.dataitems.ScalarDataItem opengate.actors.dataitems.ItkImageDataItem opengate.actors.dataitems.MeanItkImageDataItem opengate.actors.dataitems.DataContainer opengate.actors.dataitems.DataDictionary opengate.actors.dataitems.DataItemContainer opengate.actors.dataitems.SingleArray opengate.actors.dataitems.DoubleArray opengate.actors.dataitems.SingleItkImage opengate.actors.dataitems.SingleMeanItkImage opengate.actors.dataitems.SingleItkImageWithVariance opengate.actors.dataitems.QuotientItkImage opengate.actors.dataitems.QuotientMeanItkImage Functions --------- .. autoapisummary:: opengate.actors.dataitems.merge_data Module Contents --------------- .. py:class:: DataItem(*args, data=None, meta_data=None, **kwargs) .. py:attribute:: data :value: None .. py:attribute:: meta_data .. py:method:: set_data(data, **kwargs) .. py:property:: data_is_none .. py:method:: _assert_data_is_not_none() .. py:method:: __add__(other) .. py:method:: __iadd__(other) .. py:method:: __mul__(other) .. py:method:: __imul__(other) .. py:method:: __truediv__(other) .. py:method:: __getattr__(item) .. py:method:: merge_with(other) The base class implements merging as summation. Specific classes can override this, e.g. to merge mean values. .. py:method:: inplace_merge_with(other) The base class implements merging as summation. Specific classes can override this, e.g. to merge mean values. .. py:method:: write(*args, **kwargs) :abstractmethod: .. py:property:: number_of_samples .. py:class:: MeanValueDataItemMixin This class cannot be instantiated on its own. It is solely meant to be mixed into a class that inherits from DataItem (or daughters). Important: It must appear before the main base class in the inheritance order so that the overloaded methods take priority. .. py:attribute:: number_of_samples :type: int .. py:method:: merge_with(other) .. py:method:: inplace_merge_with(other) .. py:class:: ArithmeticDataItem(*args, data=None, meta_data=None, **kwargs) Bases: :py:obj:`DataItem` Base class for data items where the data component already has implemented arithmetic operators. Examples: Scalars, Numpy arrays, etc. .. py:method:: __iadd__(other) .. py:method:: __add__(other) .. py:method:: __mul__(other) .. py:method:: __imul__(other) .. py:method:: __truediv__(other) .. py:method:: __itruediv__(other) .. py:method:: write(path, **kwargs) .. py:class:: ArrayDataItem(*args, data=None, meta_data=None, **kwargs) Bases: :py:obj:`ArithmeticDataItem` Base class for data items where the data component already has implemented arithmetic operators. Examples: Scalars, Numpy arrays, etc. .. py:method:: set_data(data) .. py:class:: ScalarDataItem(*args, data=None, meta_data=None, **kwargs) Bases: :py:obj:`ArithmeticDataItem` Base class for data items where the data component already has implemented arithmetic operators. Examples: Scalars, Numpy arrays, etc. .. py:method:: write(*args, **kwargs) :abstractmethod: .. py:class:: ItkImageDataItem(*args, data=None, meta_data=None, **kwargs) Bases: :py:obj:`DataItem` .. py:property:: image .. py:method:: __iadd__(other) .. py:method:: __add__(other) .. py:method:: __mul__(other) .. py:method:: __imul__(other) .. py:method:: __truediv__(other) .. py:method:: __itruediv__(other) .. py:method:: set_image_properties(**properties) .. py:method:: get_image_properties() .. py:method:: copy_image_properties(other_image) .. py:method:: create_empty_image(size, spacing, origin=None, pixel_type='float', allocate=True, fill_value=0) .. py:method:: write(path) .. py:class:: MeanItkImageDataItem(*args, data=None, meta_data=None, **kwargs) Bases: :py:obj:`MeanValueDataItemMixin`, :py:obj:`ItkImageDataItem` This class represents an ITK image which is meant to hold mean values per voxel. The class MeanValueDataItemMixin therefore overloads the merge_with and inplace_merge_with methods. .. py:class:: DataContainer(belongs_to, *args, **kwargs) Common base class for all containers. Nothing implemented here for now. .. py:attribute:: belongs_to .. py:class:: DataDictionary(initial_dict, *args, encoder='json', **kwargs) Bases: :py:obj:`DataContainer` Common base class for all containers. Nothing implemented here for now. .. py:attribute:: data .. py:method:: write(path) .. py:class:: DataItemContainer(*args, data=None, **kwargs) Bases: :py:obj:`DataContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes :value: () .. py:attribute:: data .. py:method:: get_default_data_item_config() :classmethod: .. py:property:: data_item_config .. py:property:: _tuple_length .. py:property:: meta_data .. py:method:: update_meta_data(meta_data) .. py:method:: set_data(*data, item=None) .. py:method:: get_data_item_object(item) .. py:method:: get_data(item=0) .. py:property:: data_is_none .. py:method:: _assert_data_is_not_none() .. py:method:: propagate_operator(other, operator) .. py:method:: propagate_operator_inplace(other, operator) .. py:method:: __iadd__(other) .. py:method:: __add__(other) .. py:method:: __imul__(other) .. py:method:: __mul__(other) .. py:method:: __itruediv__(other) .. py:method:: __truediv__(other) .. py:method:: inplace_merge_with(other) .. py:method:: merge_with(other) .. py:method:: write(path, item, **kwargs) .. py:method:: __getattr__(item) .. py:class:: SingleArray(*args, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:class:: DoubleArray(*args, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:class:: SingleItkImage(*args, data=None, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:property:: image .. py:class:: SingleMeanItkImage(*args, data=None, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:class:: SingleItkImageWithVariance(*args, data=None, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:attribute:: default_data_item_config .. py:method:: get_variance_or_uncertainty(which_quantity) .. py:property:: variance .. py:property:: std .. py:property:: uncertainty .. py:class:: QuotientItkImage(*args, data=None, **kwargs) Bases: :py:obj:`DataItemContainer` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:attribute:: default_data_item_config .. py:property:: quotient .. py:class:: QuotientMeanItkImage(*args, data=None, **kwargs) Bases: :py:obj:`QuotientItkImage` This is a base class. Inherit from it to implement specific containers. .. py:attribute:: _data_item_classes .. py:function:: merge_data(list_of_data) .. py:data:: available_data_container_classes