camitk.ImageComponent

class camitk.ImageComponent

The manager of the Image Volume data. An image volume data has no concrete 3D representation, as its representation is provided by its sub-components (axial, sagittal, coronal and arbitrary slices as well as volume rendering).

It builds a complete/ready-to-use VTK pipeline:

See also

Slice

You can use the following properties to change the visualization of an ImageComponent and children components: - “Display Image in 3D Viewer” type boolean, controls what is displayed in the default 3D viewer

Every time a property is changed using setProperty(QString propertyName, QVariant value), the ImageComponent will automatically update, thanks to the propertyValueChanged(..) method.

__init__(self: camitk.ImageComponent, arg0: str, arg1: str) None

Creates an ImageComponent from a file. This method is called from a ComponentExtension derived class that support the given file format.

This method may throw an AbortException if a problem occurs.

Parameter file: the complete path to the image file

Parameter name: name to be given to the Component (this name will appear in the explorer)

Methods

__init__(self, arg0, arg1)

Creates an ImageComponent from a file.

addChild(self, arg0)

add a child Component (sub item in the hierarchy), and modify the child's parent to be equal to this instance

clone(self)

Clone this original image.

getArbitrarySliceFrame(self)

Returns the FrameOfReference used for the arbitrary slice.

getChildren(self)

get the list of the InterfaceNode children (sub items in the hierarchy)

getDataFrame(self)

get the data FrameOfReference (i.e., the vtkImageData frame)

getDimensions(self)

Returns the image dimensions as a tuple of 3 integers (dimX, dimY, dimZ).

getFileName(self)

get the file name where the data have to be stored/were stored

getFrame(self)

Get the pointer to this object's FrameOfReference.

getImageDataAsNumpy(self)

Returns the image data as a numpy ndarray.

getLastPixelPicked(self)

Get the last pixel picked using CTRL + LEFT/RIGHT CLICK in voxel index (i, j, k) indicates the voxel index (no notion of voxel size)

getLastPointPickedDataFrame(self)

Get the last point picked using CTRL + LEFT/RIGHT CLICK in the data frame coordinates (this takes into account voxel size)

getLastPointPickedWorldFrame(self)

Get Get the last point picked using CTRL + LEFT/RIGHT CLICK in the world coordinates This takes into account voxel size and image origin (and possible image rigid transforms).

getName(self)

get the name to be displayed

getParent(self)

get the parent Component

getPropertyValue(self, arg0)

get the property QVariant (same as property(const char*)) but check if it exists first.

getSpacing(self)

Returns the image spacing as a tuple of 3 floats (spacingX, spacingY, spacingZ).

isSelected(self)

Check if this data component is selected

isTopLevel(self)

return true if this component is a top-level component

refresh(self)

refresh all the viewer that are currently displaying this Component At the end the InterfaceNode modification flag is reset.

replaceImageData(self, arg0)

Replaces the image data with the given numpy ndarray.

setFrame(self, arg0)

Set the FrameOfReference of this object.

setFrameFrom(self, arg0)

Modify this object's frame using the given object's frame.

setModified(self, arg0)

set the modified flag

setName(self, arg0)

set the name to be displayed

setPropertyValue(self, arg0, arg1)

set the property QVariant value (same as setProperty(const char*, newValue)) but check if it exists first.

setSelected(self, b[, recursive])

Update the selection flag.

Attributes

NoRenderingMode

Points

Surface

Wireframe