Sisyphe.core.sisypheImageAttributes

External packages/modules

class Sisyphe.core.sisypheImageAttributes.SisypheACPC(parent: SisypheVolume | None = None)

Description

Class to manage anterior (AC) and posterior (PC) commissure attributes of images. Generate rigid geometric transformation, x and z rotations calculated from AC-PC, i.e. geometric transformation to reference with axes aligned on the AC-PC line, with midACPC point as center of rotation.

This class is usually an attribute of the Sisyphe.core.sisypheVolume.SisypheVolume class (acpc property or getACPC() method).

Inheritance

object -> SisypheACPC

Creation: 12/04/2023 Last revision: 12/12/2023

copy() SisypheACPC

Copy the current SisypheACPC instance (deep copy).

Returns

SisypheACPC

acpc copy

copyFrom(buff: SisypheACPC | SisypheVolume) None

Copy attributes of the ACPC parameter to the current SisypheACPC instance (deep copy).

Parameters

buffSisypheACPC | Sisyphe.core.sisypheVolume.SisypheVolume

acpc to copy

createXML(doc: Document, currentnode: Element) None

Write current SisypheACPC instance attributes to xml instance.

Parameters

docminidom.Document

xml document

currentnodeminidom.Element

xml root node

getAC() tuple[float, float, float]

Get AC coordinates attribute of the current SisypheACPC instance.

Returns

tuple[float, float, float]

AC coordinates

getACPCDistance() float

Get euclidean distance between AC and PC points.

Returns

float

euclidean distance in mm between AC and PC

getEquivalentVolumeCenteredTransform() SisypheTransform

Get geometric transformation attribute of the current SisypheACPC instance. Conversion of the geometric transformation, changing the center of rotation from midACPC to the center of the volume.

    1. Apply forward translation, mid CA-CP to volume center (translation = volume center - mid CA-CP)

    1. Apply rotation, after forward translation, center of rotation is volume center

    1. Apply backward translation, volume center to mid CA-CP

Returns

Sisyphe.core.sisypheTransform.SisypheTransform

geometric transformation

getEquivalentVolumeCenteredTransform2() SisypheTransform

Get geometric transformation attribute of the current SisypheACPC instance. Conversion of the geometric transformation, changing the center of rotation from midACPC to the center of the volume.

Forward centered transform (center of rotation = volume center). Widget center of rotation is at the cursor position, not always in the volume center.

    1. apply translations to move center of rotation (cursor position -> volume center) before rotation

    1. apply rotations

It’s not classic roto-translation matrix that has an inverse order (1. rotations 2. translations). Correct transformation is pre-multiply of the translation matrix by the rotation matrix.

Returns

Sisyphe.core.sisypheTransform.SisypheTransform

geometric transformation

getEuclideanDistanceFromAC(p: tuple[float, float, float] | list[float]) float

Get euclidean distance between AC and parameter point.

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

float

euclidean distance in mm between AC and p

getEuclideanDistanceFromMidACPC(p: tuple[float, float, float] | list[float]) float

Get euclidean distance between midACPC and parameter point.

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

float

euclidean distance in mm between midACPC and p

getEuclideanDistanceFromPC(p: tuple[float, float, float] | list[float]) float

Get euclidean distance between PC and parameter point.

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

float

euclidean distance in mm between PC and p

classmethod getFileExt() str

Get SisypheACPC file extension.

Returns

str

‘.xacpc’

classmethod getFilterExt() str

Get SisypheACPC filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().

Returns

str

‘PySisyphe ACPC (.xacpc)’

getMidACPC() tuple[float, float, float]

Get midACPC coordinates of the current SisypheACPC instance.

Returns

tuple[float, float, float]

midACPC coordinates

getPC() tuple[float, float, float]

Get PC coordinates attribute of the current SisypheACPC instance.

Returns

tuple[float, float, float]

PC coordinates

getParent() SisypheVolume

Get parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheACPC instance.

Returns

Sisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

getPointFromRelativeDistanceToAC(r: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get coordinates of a point giving relative distances from AC point in each axis x (lat), y (ap) and z (h), in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to AC -> AC in AC-PC space (AC-PC line aligned to axes in this space)

  • New point = addBundle relative distances r to AC in AC-PC space

  • Apply transformation to new point -> new point in native space

Parameters

rtuple[float, float, float] | list[float, float, float]

relative distances in each axis x (lat), y (ap) and z (h)

Returns

tuple[float, float, float]

point coordinates

getPointFromRelativeDistanceToMidACPC(r: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get coordinates of a point giving relative distances from midACPC point in each axis x (lat), y (ap) and z (h), in the geometric reference frame with axes aligned on the AC-PC line.

  • midACPC is already in AC-PC space (midACPC is the center of rotation, invariant to transformation)

  • New point = addBundle relative distances r to midACPC

  • Apply transformation to new point -> new point in native space

Parameters

rtuple[float, float, float] | list[float, float, float]

relative distances in each axis x (lat), y (ap) and z (h)

Returns

tuple[float, float, float]

point coordinates

getPointFromRelativeDistanceToPC(r: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get coordinates of a point giving relative distances from PC point in each axis x (lat), y (ap) and z (h), in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to PC -> PC in AC-PC space (AC-PC line aligned to axes in this space)

  • New point = addBundle relative distances r to PC in AC-PC space

  • Apply transformation to new point -> new point in native space

Parameters

rtuple[float, float, float] | list[float, float, float]

relative distances in each axis x (lat), y (ap) and z (h)

Returns

tuple[float, float, float]

point coordinates

getPointFromRelativeDistanceToReferencePoint(r: tuple[float, float, float] | list[float], ref: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get coordinates of a point giving relative distances from a second reference point in each axis x (lat), y (ap) and z (h), in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to ref point -> ref point in AC-PC space (AC-PC line aligned to axes)

  • New point = addBundle relative distances r to ref point in AC-PC space

  • Apply transformation to new point -> new point in native space

Parameters

rtuple[float, float, float] | list[float, float, float]

relative distances in each axis x (lat), y (ap) and z (h)

reftuple[float, float, float] | list[float, float, float]

reference point coordinates

Returns

tuple[float, float, float]

point coordinates

getRelativeDistanceFromAC(p: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get relative distance between a point and AC in each axis x (lat), y (ap) and z (h) in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to AC -> AC in AC-PC space (AC-PC line aligned to axes in this space)

  • Apply inverse transformation to p point -> p point in AC-PC space

  • Return relative distance between AC and p point in AC-PC space

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

tuple[float, float, float]

lat, ap and h, relative distance in mm between p and AC in the reference frame with axes aligned on the AC-PC line

getRelativeDistanceFromMidACPC(p: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get relative distance between a point and midACPC in each axis x (lat), y (ap) and z (h) in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to p point -> p point in AC-PC space

  • Mid AC-PC is already in AC-PC space (Mid AC-PC is the center of rotation, invariant to transformation)

  • Return relative distance between mid AC-PC and p point in AC-PC space

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

tuple[float, float, float]

lat, ap and h, relative distance in mm between p and midACPC in the reference frame with axes aligned on the AC-PC line

getRelativeDistanceFromPC(p: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get relative distance between a point and PC in each axis x (lat), y (ap) and z (h) in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to PC -> PC in AC-PC space (AC-PC line aligned to axes in this space)

  • Apply inverse transformation to p point -> p point in AC-PC space

  • Return relative distance between PC and p point in AC-PC space

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

Returns

tuple[float, float, float]

lat, ap and h, relative distance in mm between p and PC in the reference frame with axes aligned on the AC-PC line

getRelativeDistanceFromReferencePoint(p: tuple[float, float, float] | list[float], ref: tuple[float, float, float] | list[float]) tuple[float, float, float]

Get relative distance between a point and a second reference point in each axis x (lat), y (ap) and z (h) in the geometric reference frame with axes aligned on the AC-PC line.

  • Apply inverse transformation to ref point -> ref point in AC-PC space (AC-PC line aligned to axes in this space)

  • Apply inverse transformation to p point -> p point in AC-PC space

  • Return relative distance between ref point and p point in AC-PC space

Parameters

ptuple[float, float, float] | list[float, float, float]

point coordinates

reftuple[float, float, float] | list[float, float, float]

reference point coordinates

Returns

tuple[float, float, float]

lat, ap and h, relative distance in mm between p and ref in the reference frame with axes aligned on the AC-PC line

getRotations(deg: bool = False) list[float]

Get rotation around Y-axis with update of geometric transformation attribute of the current SisypheACPC instance.

Parameters

degbool

degrees if True, radians otherwise (default False)

Returns

list[float]

rotations around x-axis, y-axis and z-axis

getTransform() SisypheTransform

Get geometric transformation attribute of the current SisypheACPC instance. Geometric transformation to reference frame with axes aligned on the AC-PC line, and midACPC point as center of rotation.

Returns

Sisyphe.core.sisypheTransform.SisypheTransform

geometric transformation

hasAC() bool

Check whether AC attribute of the current SisypheACPC instance is defined (not 0.0, 0.0 0.0).

Returns

bool

True if AC is defined (not 0.0, 0.0 0.0)

hasACPC() bool

Check whether AC and PC attributes of the current SisypheACPC instance is defined (not 0.0, 0.0 0.0).

Returns

bool

True if AC is defined (not 0.0, 0.0 0.0)

hasPC() bool

Check whether PC attribute of the current SisypheACPC instance is defined (not 0.0, 0.0 0.0).

Returns

bool

True if AC is defined (not 0.0, 0.0 0.0)

hasParent() bool

Check whether current SisypheACPC instance has a parent (Sisyphe.core.sisypheVolume.SisypheVolume instance), i.e. parent attribute is not None.

Returns

bool

True if current SisypheACPC is defined (not None)

hasTransform() bool

Check whether geometric transformation attribute of the current SisypheAPC instance is not identity.

Returns

bool

True if geometric transformation is not identity

loadFromXML(filename: str) None

Load current SisypheACPC instance attributes from xml file (.xacpc).

Parameters

filenamestr

xml file name (.xacpc)

parseXML(doc: Document) None

Read current SisypheACPC instance attributes from xml instance.

Parameters

docminidom.Document

xml document

saveToXML(filename: str) None

Save current SisypheACPC instance attributes to xml file (.xacpc).

Parameters

filenamestr

xml file name (.xacpc)

setAC(v: tuple[float, float, float] | list[float]) None

Set AC coordinates attribute of the current SisypheACPC instance.

Parameters

vtuple[float, float, float]

AC coordinates

setPC(v: tuple[float, float, float] | list[float]) None

Set PC coordinates attribute of the current SisypheACPC instance.

Parameters

vtuple[float, float, float]

PC coordinates

setParent(parent: SisypheVolume) None

Set parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheACPC instance.

Parameters

parentSisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

setTransform(trf: SisypheTransform) None

Set geometric transformation attribute of the current SisypheACPC instance. Geometric transformation to reference frame with axes aligned on the AC-PC line, and midACPC point as center of rotation.

Parameters

trfSisyphe.core.sisypheTransform.SisypheTransform

geometric transformation

setYRotation(r: float, deg: bool = False) None

Set rotation around Y-axis with update of geometric transformation attribute of the current SisypheACPC instance.

Parameters

rfloat

Y rotation

degbool

rotation in degrees if True, radians otherwise (default False)

class Sisyphe.core.sisypheImageAttributes.SisypheAcquisition(modality: int = 0, sequence: str = '', d: date = datetime.date(2025, 5, 20), unit: str = 'None', parent: SisypheVolume | None = None)

Description

Class to manage acquisition attributes of images: modality, sequence, date of scan, frame, scalar value unit, labels for LB modality, degrees of freedom and autocorrelation for statistical map sequences.

This class is usually an attribute of the Sisyphe.core.sisypheVolume.SisypheVolume class (acquisition property or getAcquisition() method).

Inheritance

object -> SisypheIdentity

Creation: 16/03/2021 Last revision: 21/02/2025

CCVAL = 'cc'

PySisyphe modalities:

OT Other modality MR Magnetic Resonance Imaging CT Computed Tomography PT Positron Emission Tomography NM Conventional Nuclear Medicine, Single Photon Emission Computed Tomography LB Label volume TP Template volume (ATROPOS, ICBM152, ICBM425, SRI24) PJ Projection (2D image)

PVAL = 'p-value'

PySisyphe modalities:

OT Other modality MR Magnetic Resonance Imaging CT Computed Tomography PT Positron Emission Tomography NM Conventional Nuclear Medicine, Single Photon Emission Computed Tomography LB Label volume TP Template volume (ATROPOS, ICBM152, ICBM425, SRI24) PJ Projection (2D image)

TVAL = 't-value'

PySisyphe modalities:

OT Other modality MR Magnetic Resonance Imaging CT Computed Tomography PT Positron Emission Tomography NM Conventional Nuclear Medicine, Single Photon Emission Computed Tomography LB Label volume TP Template volume (ATROPOS, ICBM152, ICBM425, SRI24) PJ Projection (2D image)

ZSCORE = 'z-score'

PySisyphe modalities:

OT Other modality MR Magnetic Resonance Imaging CT Computed Tomography PT Positron Emission Tomography NM Conventional Nuclear Medicine, Single Photon Emission Computed Tomography LB Label volume TP Template volume (ATROPOS, ICBM152, ICBM425, SRI24) PJ Projection (2D image)

copy() SisypheAcquisition

Copy the current SisypheAcquisition instance (deep copy).

Returns

SisypheAcquisition

acquisition copy

copyFrom(buff: SisypheAcquisition | SisypheVolume) None

Copy attributes of the acquisition parameter to the current SisypheAcquisition instance (deep copy).

Parameters

buffSisypheAcquisition | Sisyphe.core.sisypheVolume.SisypheVolume

acquisition to copy

createXML(doc: Document, currentnode: Element) None

Write current SisypheAcquisition instance attributes to xml instance.

Parameters

docminidom.Document

xml document

currentnodeminidom.Element

xml root node

classmethod getATROPOSTemplateTag() str

Get ATROPOS template str.

Returns

str

ATROPOS template str

getAgeAtScanDate(dateofbirthday: str | SisypheIdentity | date, f: str = '%Y-%m-%d') int

Get the patient’s age supplied as parameter on the scan date.

Parameters

dateofbirthdaystr | SisypheIdentity | datetime.date

birthdate as str, birthdate attribute of the SisypheIdentity instance or datetime.date

fstr

format used to convert date to str (default ‘%Y-%m-%d’)

Returns

int

patient age

getAutoCorrelations() tuple[float, float, float]

Get autocorrelations attribute of the current SisypheAcquisition instance. This attribute is only defined for statistical maps.

Returns

tuple[float, float, float] | list[float, float, float]

autocorrelations

classmethod getCTModalityTag() str

Get CT-scan modality str.

Returns

str

CT-scan modality str

classmethod getCTSequences() tuple[str, ...]

Get tuple of CT-scan sequence names.

Returns

tuple[str, …]

tuple of CT-scan sequence names

classmethod getCodeToModalityDict() dict[int, str]

Get dict with modality code as key and modality name as value.

Returns

dict[int, str]

{0: ‘OT’, 1: ‘MR’, 2: ‘CT’, 3: ‘PT’, 4: ‘NM’, 5: ‘LB’, 6: ‘TP’}

getContrast() list[float]

Get contrast attribute of the current SisypheAcquisition instance. This attribute is only defined for statistical maps.

Returns

list[float]

contrast used to calculate statistical map

getDateOfScan(string: bool = True, f: str = '%Y-%m-%d') str | date

Get date of scan attribute of the current SisypheAcquisition instance.

Parameters

stringbool
  • if True return date of scan as str

  • if False return date of scan as datetime.date

fstr

format used to convert date to str (default ‘%Y-%m-%d’)

Returns

str | datetime.date

date of scan as str or datetime.date

getDegreesOfFreedom() int

Get degrees of freedom attribute of the current SisypheAcquisition instance. This attribute is only defined for some statistical maps (i.e. ‘t-value’, ‘p-value’).

Returns

int

degrees of freedom

classmethod getFileExt() str

Get SisypheAcquisition file extension.

Returns

str

‘.xacq’

classmethod getFilterExt() str

Get SisypheAcquisition filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().

Returns

str

‘PySisyphe Acquisition (.xacq)’

getFrame() int

Get frame code attribute of the current SisypheAcquisition instance (0 unknown, 1 no frame, 2 Leksell frame).

Returns

int

frame code attribute

getFrameAsString() str

Get frame str attribute of the current SisypheAcquisition instance (‘UNKNOWN’, ‘NO FRAME’, ‘LEKSELL’).

Returns

str

frame str attribute

classmethod getFrameList() tuple[str, ...]

Get tuple of frame names.

Returns

tuple[str, …]

tuple frame names

classmethod getICBM152TemplateTag() str

Get ICBM152 template str.

Returns

str

ICBM152 template str

classmethod getICBM452TemplateTag() str

Get ICBM452 template str.

Returns

str

ICBM452 template str

classmethod getLBModalityTag() str

Get Label modality str.

Returns

str

Label modality str

classmethod getLBSequences() tuple[str, ...]

Get tuple of label sequence names.

Returns

tuple[str, …]

tuple of label sequence names

getLabel(index: float | int) str

Get label name from index value, only defined for label modality.

Parameters

indexfloat | int

index

Returns

str

label name

getLabels() dict[int, str]

Get label table, only defined for label modality.

Returns

dict[int, str]
  • int key, index

  • str value, label name

classmethod getLabelsFileExt() str

Get XML labels file extension.

Returns

str

‘.xlabels’

classmethod getLabelsFilterExt() str

Get XML labels filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().

Returns

str

‘PySisyphe Labels (.xlabels)’

classmethod getMRModalityTag() str

Get MRI modality str.

Returns

str

MRI modality str

classmethod getMRSequences() tuple[str, ...]

Get tuple of MRI sequence names.

Returns

tuple[str, …]

tuple of OT sequence names

getModality(string: bool = True) str | int

Get modality attribute of the current SisypheAcquisition instance.

Parameters

stringbool

returns modality str if True, otherwise int code (default True)

Returns

str | int

modality str or int code

classmethod getModalityToCodeDict() dict[str, int]

Get dict with modality name as key and modality code as value.

Returns

dict[str, int]

{‘OT’: 0, ‘MR’: 1, ‘CT’: 2, ‘PT’: 3, ‘NM’: 4, ‘LB’: 5, ‘TP’: 6}

classmethod getNMModalityTag() str

Get Nuclear Medicine modality str.

Returns

str

Nuclear Medicine modality str

classmethod getNMSequences() tuple[str, ...]

Get tuple of Nuclear Medicine radiopharmaceutical names.

Returns

tuple[str, …]

tuple of Nuclear Medicine radiopharmaceutical names

classmethod getOTModalityTag() str

Get OT modality str.

Returns

str

OT modality str

classmethod getOTSequences() tuple[str, ...]

Get tuple of OT sequence names.

Returns

tuple[str, …]

tuple of OT sequence names

classmethod getPJModalityTag() str

Get Template modality str.

Returns

str

Projection modality str

classmethod getPJSequences() tuple[str, ...]

Get tuple of projection sequence names.

Returns

tuple[str, …]

tuple of projection sequence names

classmethod getPTModalityTag() str

Get PET-scan modality str.

Returns

str

PET-scan modality str

classmethod getPTSequences() tuple[str, ...]

Get tuple of PET radiopharmaceutical names.

Returns

tuple[str, …]

tuple of PET radiopharmaceutical names

getParent() SisypheVolume

Get parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheAcquisition instance.

Returns

Sisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

classmethod getSRI24TemplateTag() str

Get SRI24 template str.

Returns

str

SRI24 template str

getSequence() str

Get current SisypheAcquisition instance sequence attribute.

Returns

str

sequence attribute

classmethod getTPModalityTag() str

Get Template modality str.

Returns

str

Template modality str

classmethod getTPSequences() tuple[str, ...]

Get tuple of template sequence names.

Returns

tuple[str, …]

tuple of template sequence names

classmethod getTemplatesList() tuple[str, ...]

Get tuple of template names.

Returns

tuple[str, …]

tuple template names

getType() str

Get type attribute (‘2D’, ‘3D’) of the current SisypheAcquisition instance.

Returns

str

acquisition type (‘2D’, ‘3D’)

getUnit() str

Get unit attribute of the current SisypheAcquisition instance.

Returns

str

unit attribute

classmethod getUnitList() tuple[str, ...]

Get tuple of units names.

Returns

tuple[str, …]

tuple units names

hasContrast() bool

Check that contrast attribute is not empty, only defined for statistical map.

Returns

bool

True if contrast attribute is not empty

hasLabels() bool

Check that label table is not empty, only defined for label modality.

Returns

bool

True if label table is not empty

hasParent() bool

Check whether current SisypheAcquisition instance has a parent (Sisyphe.core.sisypheVolume.SisypheVolume instance), i.e. parent attribute is not None.

Returns

bool

True if current SisypheAcquisition is defined (not None)

hasUnit() bool

Check whether the current SisypheAcquisition instance unit attribute is defined.

Returns

bool

True if the unit attribute is defined

is2D() bool

Check whether type attribute of the current SisypheAcquisition instance is 2D.

Returns

bool

True if 2D acquisition

is3D() bool

Check whether type attribute of the current SisypheAcquisition instance is 3D.

Returns

bool

True if 3D acquisition

isATROPOS() bool

Check whether the current SisypheAcquisition instance attributes are Template modality and ATROPOS sequence.

Returns

bool

True if Template modality and ATROPOS sequence

isBrainstemMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a brainstem map.

Returns

bool

True if sequence is a brainstem map

isCMAP() bool

Check whether the current SisypheAcquisition instance sequence attribute is a correlation coeff. map.

Returns

bool, True if sequence is a correlation coeff. map

isCT() bool

Check whether the current SisypheAcquisition instance modality attribute is CT-scan.

Returns

bool

True if CT-scan modality

isCerebellumMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a cerebellum map.

Returns

bool

True if sequence is a cerebellum map

isCerebroSpinalFluidMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a cerebro-spinal fluid map.

Returns

bool

True if sequence is a cerebro-spinal fluid map

isContrastEnhanced() bool

Check whether the current SisypheAcquisition instance sequence attribute is contrast enhanced.

Returns

bool

True if sequence is contrast enhanced

isCustomSequence() bool

Check whether the current SisypheAcquisition instance sequence attribute is not standard. A standard sequence has a standardized str value in SisypheAcquisition instance.

Returns

bool

True if sequence is not standard

isCustomUnit() bool

Check whether the current SisypheAcquisition instance unit attribute is not standard. A standard unit has a standardized str value in SisypheAcquisition instance.

Returns

bool

True if unit is not standard

isDisplacementField() bool

Check whether the current SisypheAcquisition instance sequence attribute is a displacement field.

Returns

bool

True if sequence is a displacement field

isEqual(buff: SisypheAcquisition) bool

Check whether parameter instance and current SisypheAcquisition instance have the same modality, sequence and date of scan attributes. self == other -> bool

Parameters

buffSisypheAcquisition

acquisition to compare

Returns

bool

True if same acquisition

isGreyMatterMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a gray matter map.

Returns

bool

True if sequence is a grey matter map

isICBM152() bool

Check whether the current SisypheAcquisition instance attributes are Template modality and ICBM152 sequence.

Returns

bool

True if Template modality and ICBM152 sequence

isICBM452() bool

Check whether the current SisypheAcquisition instance attributes are Template modality and ICBM452 sequence.

Returns

bool

True if Template modality and ICBM452 sequence

isLB() bool

Check whether the current SisypheAcquisition instance modality attribute is Label.

Returns

bool

True if Label modality

isMR() bool

Check whether the current SisypheAcquisition instance modality attribute is MRI.

Returns

bool

True if MRI modality

isNM() bool

Check whether the current SisypheAcquisition instance modality attribute is Nuclear Medicine.

Returns

bool

True if Nuclear Medicine modality

isNotEqual(buff: SisypheAcquisition) bool

Check whether parameter instance and current SisypheAcquisition instance have not the same modality, sequence or date of scan attributes. self != other -> bool

Parameters

buffSisypheAcquisition

acquisition to compare

Returns

bool

True if acquistions are different

isOT() bool

Check whether the current SisypheAcquisition instance modality attribute is OT.

Returns

bool

True if OT modality

isPJ() bool

Check whether the current SisypheAcquisition instance modality attribute is Projection.

Returns

bool

True if Projection modality

isPT() bool

Check whether the current SisypheAcquisition instance modality attribute is PET.

Returns

bool

True if TEP modality

isSRI24() bool

Check whether the current SisypheAcquisition instance attributes are Template modality and SRI24 sequence.

Returns

bool

True if Template modality and SRI24 sequence

isStandardSequence() bool

Check whether the current SisypheAcquisition instance sequence attribute is standard. A standard sequence has a standardized str value in SisypheAcquisition instance.

Returns

bool

True if sequence is standard

isStandardUnit() bool

Check whether the current SisypheAcquisition instance unit attribute is standard. A standard unit has a standardized str value in SisypheAcquisition instance.

Returns

bool

True if unit is standard

isStatisticalMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a t-map, a z-map or a correlation coeff. map.

Returns

bool

True if sequence is a t-map, a z-map or a correlation coeff. map

isSubCorticalGreyMatterMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a subcortical gray matter map.

Returns

bool

True if sequence is a grey matter map

isTMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a t-map.

Returns

bool

True if sequence is a t-map

isTP() bool

Check whether the current SisypheAcquisition instance modality attribute is Template.

Returns

bool

True if Template modality

isTemplate() bool

Check whether the current SisypheAcquisition instance modality attribute is Template.

Returns

bool

True if Template modality

isWhiteMatterMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a white matter map.

Returns

bool

True if sequence is a white matter map

isZMap() bool

Check whether the current SisypheAcquisition instance sequence attribute is a z-map.

Returns

bool, True if sequence is a z-map

loadFromXML(filename: str) None

Load current SisypheAcquisition instance attributes from xml file (.xacq).

Parameters

filenamestr

xml file name (.xacq)

loadLabels() None

Load label table from XML file (.xlabels), image modality must be label.

parseXML(doc: Document) None

Read current SisypheAcquisition instance attributes from xml instance.

Parameters

docminidom.Document

xml document

saveLabels() None

Save label table from XML file (.xlabels), only defined for label modality.

saveToXML(filename: str) None

Save current SisypheAcquisition instance attributes to xml file (.xacq).

Parameters

filenamestr

xml file name (.xacq)

set2D() None

Set type attribute of the current SisypheAcquisition instance to 2D.

set3D() None

Set type attribute of the current SisypheAcquisition instance to 3D.

setAutoCorrelations(v: list[float] | tuple[float, float, float] | ndarray) None

Set autocorrelations attribute of the current SisypheAcquisition instance. This attribute is only defined for statistical maps.

Parameters

vtuple[float, float, float] | list[float, float, float] | ndarray

autocorrelations

setContrast(c: ndarray | list[float]) None

Set contrast attribute of the current SisypheAcquisition instance. This attribute is only defined for statistical maps.

Parameters

cndarray | list[float]

contrast used to calculate statistical map

setDateOfScan(buff: str | date = datetime.datetime(2025, 5, 20, 17, 40, 15, 319916), f: str = '%Y-%m-%d') None

Set the date of scan attribute of the current SisypheAcquisition instance.

Parameters

buffstr | datetime.date

date of scan as str or datetime.date (default datetime.today())

fstr

format used to convert date to str (default ‘%Y-%m-%d’)

setDegreesOfFreedom(v) None

Set degrees of freedom attribute of the current SisypheAcquisition instance. This attribute is only defined for some statistical maps (i.e. ‘t-value’, ‘p-value’).

Parameters

vint

degrees of freedom

setFrame(v: int) None

Set frame code attribute of the current SisypheAcquisition instance (0 unknown, 1 no frame, 2 Leksell frame).

Parameters

vint

frame code attribute

setFrameAsString(v: str) None

Set frame str attribute of the current SisypheAcquisition instance (‘UNKNOWN’, ‘NO FRAME’, ‘LEKSELL’).

Parameters

vstr

frame str attribute

setFrameToLeksell() None

Set the current SisypheAcquisition instance frame attribute to Leksell.

setFrameToNo() None

Set the current SisypheAcquisition instance frame attribute to no frame.

setFrameToUnknown() None

Set the current SisypheAcquisition instance frame attribute to unknown.

setLabel(index: int, value: str) None

Set label name for an index value, image modality must be label.

Parameters

indexfloat | int

index

valuestr

label name

setLabels(v: SisypheAcquisition | SisypheVolume | dict[int, str]) None

Set label name for an index value, image modality must be label.

Parameters

vSisypheAcquisition | Sisyphe.core.sisypheVolume.SisypheVolume | dict[int, str]

Label dict from SisypheAcquisition or Sisyphe.core.sisypheVolume.SisypheVolume

setModality(buff: int | str) None

Set modality attribute of the current SisypheAcquisition instance.

Parameters

buffstr | int

modality str or int code

setModalityToCT() None

Set modality attribute of the current SisypheAcquisition instance to CT-scan.

setModalityToLB() None

Set modality attribute of the current SisypheAcquisition instance to Label.

setModalityToMR() None

Set modality attribute of the current SisypheAcquisition instance to MRI.

setModalityToNM() None

Set modality attribute of the current SisypheAcquisition instance to Nuclear Medicine.

setModalityToOT() None

Set modality attribute of the current SisypheAcquisition instance to OT.

setModalityToPJ() None

Set modality attribute of the current SisypheAcquisition instance to Projection.

setModalityToPT() None

Set modality attribute of the current SisypheAcquisition instance to PET.

setModalityToTP() None

Set modality attribute of the current SisypheAcquisition instance to Template.

setNoUnit() None

Set the unit attribute of the current SisypheAcquisition instance to no unit.

setParent(parent: SisypheVolume)

Set parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheAcquisition instance.

Parameters

parentSisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

setSequence(buff: str) None

Set the current SisypheAcquisition instance sequence attribute.

Parameters

buffstr

sequence attribute

setSequenceToAlgebraMap() None

Set sequence attribute of the current SisypheAcquisition instance to algebra map.

setSequenceToApparentDiffusionMap() None

Set sequence attribute of the current SisypheAcquisition instance to apparent diffusion map.

setSequenceToB0() None

Set sequence attribute of the current SisypheAcquisition instance to B0.

setSequenceToBiasFieldMap() None

Set sequence attribute of the current SisypheAcquisition instance to bias field map.

setSequenceToBrainstemMap() None

Set sequence attribute of the current SisypheAcquisition instance to brainstem map.

setSequenceToCMap() None

Set sequence attribute of the current SisypheAcquisition instance to correlation coeff. map.

setSequenceToCerebellumMap() None

Set sequence attribute of the current SisypheAcquisition instance to cerebellum map.

setSequenceToCerebralBloodFlowMap() None

Set sequence attribute of the current SisypheAcquisition instance to cerebral blood flow map.

setSequenceToCerebralBloodVolumeMap() None

Set sequence attribute of the current SisypheAcquisition instance to cerebral blood volume map.

setSequenceToCerebroSpinalFluidMap() None

Set sequence attribute of the current SisypheAcquisition instance to cerebro-spinal fluid map.

setSequenceToContrastEnhancedCT() None

Set sequence attribute of the current SisypheAcquisition instance to contrast enhanced CT-scan.

setSequenceToContrastEnhancedFLAIR() None

Set sequence attribute of the current SisypheAcquisition instance to contrast enhanced FLAIR.

setSequenceToContrastEnhancedT1() None

Set sequence attribute of the current SisypheAcquisition instance to contrast enhanced T1 weighted.

setSequenceToContrastEnhancedT2() None

Set sequence attribute of the current SisypheAcquisition instance to contrast enhanced T2 weighted.

setSequenceToContrastEnhancedTOF() None

Set sequence attribute of the current SisypheAcquisition instance to contrast enhanced TOF.

setSequenceToCorticalThicknessMap() None

Set sequence attribute of the current SisypheAcquisition instance to cortical thickness map.

setSequenceToDensityMap() None

Set sequence attribute of the current SisypheAcquisition instance to density map.

setSequenceToDiffusionWeighted() None

Set sequence attribute of the current SisypheAcquisition instance to diffusion weighted.

setSequenceToDisplacementField() None

Set sequence attribute of the current SisypheAcquisition instance to displacement field.

setSequenceToDistanceMap() None

Set sequence attribute of the current SisypheAcquisition instance to euclidean distance map.

setSequenceToDoseMap() None

Set sequence attribute of the current SisypheAcquisition instance to dose map.

setSequenceToECD() None

Set sequence attribute of the current SisypheAcquisition instance to ECD.

setSequenceToEchoPlanar() None

Set sequence attribute of the current SisypheAcquisition instance to echo-planar.

setSequenceToFDG() None

Set sequence attribute of the current SisypheAcquisition instance to FDG.

setSequenceToFLAIR() None

Set sequence attribute of the current SisypheAcquisition instance to FLAIR.

setSequenceToFPCIT() None

Set sequence attribute of the current SisypheAcquisition instance to FPCIT.

setSequenceToFractionalAnisotropyMap() None

Set sequence attribute of the current SisypheAcquisition instance to fractional anisotropy map.

setSequenceToGreyMatterMap() None

Set sequence attribute of the current SisypheAcquisition instance to gray matter map.

setSequenceToHMPAO() None

Set sequence attribute of the current SisypheAcquisition instance to HMPAO.

setSequenceToLabels() None

Set sequence attribute of the current SisypheAcquisition instance to labels.

setSequenceToMask() None

Set sequence attribute of the current SisypheAcquisition instance to mask.

setSequenceToMaximumMap() None

Set sequence attribute of the current SisypheAcquisition instance to maximum map.

setSequenceToMeanMap() None

Set sequence attribute of the current SisypheAcquisition instance to mean map.

setSequenceToMeanTransitTimeMap() None

Set sequence attribute of the current SisypheAcquisition instance to mean transit time map.

setSequenceToMedianMap() None

Set sequence attribute of the current SisypheAcquisition instance to median map.

setSequenceToMinimumMap() None

Set sequence attribute of the current SisypheAcquisition instance to minimum map.

setSequenceToPMap() None

Set sequence attribute of the current SisypheAcquisition instance to probability map.

setSequenceToPerfusionWeighted() None

Set sequence attribute of the current SisypheAcquisition instance to perfusion weighted.

setSequenceToProtonDensityWeighted() None

Set sequence attribute of the current SisypheAcquisition instance to proton density weighted.

setSequenceToStandardDeviationMap() None

Set sequence attribute of the current SisypheAcquisition instance to standard deviation map.

setSequenceToStructMap() None

Set sequence attribute of the current SisypheAcquisition instance to struct.

setSequenceToSubCorticalGreyMatterMap() None

Set sequence attribute of the current SisypheAcquisition instance to subcortical gray matter map.

setSequenceToSusceptibilityWeighted() None

Set sequence attribute of the current SisypheAcquisition instance to susceptibility weighted.

setSequenceToT1Weighted() None

Set sequence attribute of the current SisypheAcquisition instance to T1 weighted.

setSequenceToT2Star() None

Set sequence attribute of the current SisypheAcquisition instance to T2*.

setSequenceToT2Weighted() None

Set sequence attribute of the current SisypheAcquisition instance to T2 weighted.

setSequenceToTMap() None

Set sequence attribute of the current SisypheAcquisition instance to t map.

setSequenceToTimeOfFlight() None

Set sequence attribute of the current SisypheAcquisition instance to time of flight.

setSequenceToTimeToPicMap() None

Set sequence attribute of the current SisypheAcquisition instance to time to pic map.

setSequenceToWhiteMatterMap() None

Set sequence attribute of the current SisypheAcquisition instance to white matter map.

setSequenceToZMap() None

Set sequence attribute of the current SisypheAcquisition instance to Z map.

setType(v: str) None

Set type attribute (‘2D’, ‘3D’) of the current SisypheAcquisition instance.

Parameters

vstr

acquisition type (‘2D’, ‘3D’)

setUnit(unit: str) None

Set unit attribute of the current SisypheAcquisition instance.

Parameters

unitstr

unit attribute

setUnitToADCunit() None

Set the unit attribute of the current SisypheAcquisition instance to mm2/s.

setUnitToBq() None

Set the unit attribute of the current SisypheAcquisition instance to Bq.

setUnitToBqMl() None

Set the unit attribute of the current SisypheAcquisition instance to Bq/ml.

setUnitToCC() None

Set the unit attribute of the current SisypheAcquisition instance to correlation coeff.

setUnitToCount() None

Set the unit attribute of the current SisypheAcquisition instance to count.

setUnitToGy() None

Set the unit attribute of the current SisypheAcquisition instance to Gy.

setUnitToHounsfield() None

Set the unit attribute of the current SisypheAcquisition instance to Hounsfield.

setUnitToMillimeter() None

Set the unit attribute of the current SisypheAcquisition instance to millimeter.

setUnitToPValue() None

Set the unit attribute of the current SisypheAcquisition instance to p-value.

setUnitToPercent() None

Set the unit attribute of the current SisypheAcquisition instance to percent.

setUnitToRatio() None

Set the unit attribute of the current SisypheAcquisition instance to ratio.

setUnitToSUV() None

Set the unit attribute of the current SisypheAcquisition instance to SUV.

setUnitToSecond() None

Set the unit attribute of the current SisypheAcquisition instance to second.

setUnitToTValue() None

Set the unit attribute of the current SisypheAcquisition instance to t-value.

setUnitToZScore() None

Set the unit attribute of the current SisypheAcquisition instance to Z-score.

class Sisyphe.core.sisypheImageAttributes.SisypheDisplay(rangemin: float = 0.0, rangemax: float = 0.0, windowmin: float | None = None, windowmax: float | None = None, lut: SisypheLut | None = None, parent: SisypheVolume | None = None)

Description

Class to manage display attributes of images (Look-up table colormap, windowing). This class is usually an attribute of the Sisyphe.core.sisypheVolume.SisypheVolume class (display property or getDisplay() method).

Inheritance

object -> SisypheIdentity

Creation: 18/03/2021 Last revision: 13/12/2024

autoWindow(cmin: int = 1, cmax: int = 99) None

Set windowing lut attributes of the current SisypheDisplay instance.

  • minimum windowing value = cmin centile

  • maximum windowing value = cmax centile

Parameters

cminfloat

centile used for minimum windowing value

cmaxfloat

centile used for maximum windowing value

convertRangeWindowToInt() None

Conversion of windowing and scalar values attributes of the current SisypheDisplay instance to integers.

copy() SisypheDisplay

Copy the current SisypheDisplay instance (deep copy).

Returns

SisypheDisplay

display copy

copyFrom(buff: SisypheDisplay | SisypheVolume) None

Copy attributes of the display parameter to the current SisypheDisplay instance (deep copy).

Parameters

buffSisypheDisplay | Sisyphe.core.sisypheVolume.SisypheVolume

display to copy

createXML(doc: Document, currentnode: Element) None

Write current SisypheDisplay instance attributes to xml instance.

Parameters

docminidom.Document

xml document

currentnodeminidom.Element

xml root node

classmethod getFileExt() str

Get SisypheDisplay file extension.

Returns

str

‘.xdisplay’

classmethod getFilterExt() str

Get SisypheAcquisition filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().

Returns

str

‘PySisyphe Display (.xdisplay)’

getLUT() SisypheLut

Get Lut attribute of the current SisypheDisplay instance.

Returns

Sisyphe.core.sisypheLUT.SisypheLut

PySisyphe Look-up-table colormap instance

getParent() SisypheVolume

Get parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheDisplay instance.

Returns

Sisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

getRange() tuple[float, float] | tuple[int, int]

Get scalar values range attributes of the current SisypheDisplay instance.

Returns

tuple[float, float] | tuple[int, int]

minimum and maximum scalar values

getRangeMax() float | int

Get maximum scalar value attribute of the current SisypheDisplay instance.

Returns

float | int

maximum scalar value

getRangeMin() float | int

Get minimum scalar value attribute of the current SisypheDisplay instance.

Returns

float | int

minimum scalar value

getVTKLUT() vtkLookupTable

Get Lut attribute of the current SisypheDisplay instance.

Returns

vtk.vtkLookupTable

VTK Look-up-table colormap instance

getWindow() tuple[float, float] | tuple[int, int]

Get lut windowing attributes of the current SisypheDisplay instance.

Returns

tuple[float, float] | tuple[int, int]

minimum and maximum windowing values

getWindowMax() float | int

Get maximum lut windowing attribute of the current SisypheDisplay instance.

Returns

float | int

maximum windowing value

getWindowMin() float | int

Get minimum lut windowing attribute of the current SisypheDisplay instance.

Returns

float | int

minimum windowing value

hasNegativeValues() bool

Check whether scalar value minimum of the current SisypheDisplay instance is negative.

Returns

bool

True if scalar value minimum is negative

hasParent() bool

Check whether current SisypheDisplay instance has a parent (Sisyphe.core.sisypheVolume.SisypheVolume instance), i.e. parent attribute is not None.

Returns

bool

True if current SisypheDisplay is defined (not None)

hasZeroOneRange() bool

Check whether scalar values range of the current SisypheDisplay instance is normalized (0.0, 1.0).

Returns

bool

True if scalar values range is (0.0, 1.0)

isDefaultWindow() bool

Check whether minimum windowing value = minimum scalar value and maximum windowing value = maximum scalar value (no lut windowing).

Returns

bool

True if no lut windowing

loadFromXML(filename: str) None

Load current SisypheDisplay instance attributes from xml file (.xdisplay).

Parameters

filenamestr

xml file name (.xdisplay)

parseXML(doc: Document) None

Read current SisypheDisplay instance attributes from xml instance.

Parameters

docminidom.Document

xml document

saveToXML(filename: str) None

Save current SisypheDislpay instance attributes to xml file (.xdisplay).

Parameters

filenamestr

xml file name (.xdisplay)

setCTBoneWindow() None

Set windowing lut attributes of the current SisypheDisplay instance to improve bone display.

setCTBrainWindow() None

Set windowing lut attributes of the current SisypheDisplay instance to improve brain display.

setCTMetallicWindow() None

Set windowing lut attributes of the current SisypheDisplay instance to improve metallic material display.

setCenterWidthWindow(center: float, width: float) None

Set windowing lut attributes of the current SisypheDisplay instance.

  • minimum windowing value = center - (width // 2)

  • maximum windowing value = center + (width // 2)

Parameters

centerfloat

center windowing value

widthfloat

width windowing value

setDefaultLut() None

Set Lut attribute of the current SisypheDisplay instance to default (grayscale colormap).

setDefaultWindow() None

Set minimum windowing value to minimum scalar value of the image array. Set maximum windowing value to maximum scalar value of the image array.

setDefaultWindowMax() None

Set maximum windowing value of the current SisypheDisplay instance to maximum scalar value of the image array.

setDefaultWindowMin() None

Set minimum windowing value of the current SisypheDisplay instance to minimum scalar value of the image array.

setLUT(lut: str | SisypheLut) None

Set Lut attribute of the current SisypheDisplay instance.

Parameters

lutstr | Sisyphe.core.sisypheLUT.SisypheLut

Look-up-table colormap name or PySisyphe Look-up-table colormap instance

setParent(parent: SisypheVolume) None

Set parent (Sisyphe.core.sisypheVolume.SisypheVolume instance) of the current SisypheDisplay instance.

Parameters

parentSisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

setRange(vmin: float, vmax: float) None

Set scalar range attributes of the current SisypheDisplay instance.

Parameters

vminfloat

minimum scalar value

vmaxfloat

maximum scalar value

setRangeMax(v: float) None

Set maximum scalar value of the current SisypheDisplay instance.

Parameters

vfloat

maximum scalar value

setRangeMin(v: float) None

Set minimum scalar value of the current SisypheDisplay instance.

Parameters

vfloat

minimum scalar value

setWindow(vmin: float, vmax: float) None

Set windowing lut attributes of the current SisypheDisplay instance.

Parameters

vminfloat

minimum windowing value

vmaxfloat

maximum windowing value

setWindowMax(v: float) None

Set maximum windowing value of the current SisypheDisplay instance.

Parameters

vfloat

maximum windowing value

setWindowMin(v: float) None

Set minimum windowing value of the current SisypheDisplay instance.

Parameters

vfloat

minimum windowing value

updateVTKLUT() None

Apply windowing attributes to current SisypheDisplay instance.

class Sisyphe.core.sisypheImageAttributes.SisypheIdentity(firstname: str = '', lastname: str = '', gender: int = 0, dob: date = datetime.date(2000, 1, 1), parent: SisypheVolume | None = None)

Description

Class to manage patient identity attributes: lastname, firstname, gender and date of Birth.

This class is usually an attribute of the Sisyphe.core.sisypheVolume.SisypheVolume class (identity property or getIdentity() method).

Inheritance

object -> SisypheIdentity

Creation: 17/01/2020 Last revision: 05/11/2024

anonymize() None

Anonymize identity attributes of the current SisypheIdentity instance.

  • Set lastname and firstname to empty str (‘’)

  • Set gender code to 0

  • Set birthdate to default date i.e. datetime.date(1, 1, 2000)

copy() SisypheIdentity

Copy the current SisypheIdentity instance (deep copy).

Returns

SisypheIdentity

identity copy

copyFrom(buff: SisypheIdentity | SisypheVolume) None

Copy attributes of the identity parameter to the current SisypheIdentity instance (deep copy).

Parameters

buffSisypheIdentity | Sisyphe.core.sisypheVolume.SisypheVolume

identity to copy

createXML(doc: Document, currentnode: Element) None

Write current SisypheIdentity instance attributes to xml instance.

Parameters

docminidom.Document

xml document

currentnodeminidom.Element

xml root node

getAge() int

Get age as of today’s date.

Returns

int

patient age

getAgeAt(d: date) int

Get age at a given date.

Parameters

d : datetime.date

Returns

int

patient age

getDateOfBirthday(string: bool = True, f: str = '%Y-%m-%d') str | date

Get birthdate attribute of the current SisypheIdentity instance.

Parameters

stringbool
  • if True return patient birthdate as str

  • if False return patient birthdate as datetime.date

fstr

format used to convert date to str (default ‘%Y-%m-%d’)

Returns

str | datetime.date

patient birthdate as str or datetime.date

classmethod getDefaultDate() date

Get default date 01/01/2000.

Returns

datetime.date

datetime.date(1, 1, 2000)

classmethod getFileExt() str

Get SisypheIdentity file extension.

Returns

str

‘.xidentity’

classmethod getFilterExt() str

Get SisypheIdentity filter used by QFileDialog.getOpenFileName() and QFileDialog.getSaveFileName().

Returns

str

‘PySisyphe Identity (.xidentity)’

getFirstname() str

Get firstname attribute of the current SisypheIdentity instance.

Returns

str

patient firstname

getGender(string: bool = True) int | str

Get gender attribute of the current SisypheIdentity instance.

Parameters

stringbool
  • if True return gender as str (‘Unknown’, ‘Male’, ‘Female’)

  • if False return gender as int code (0 Unknown, 1 Male, 2 Female)

Returns

str | int

patient gender as str (‘Unknown’, ‘Male’, ‘Female’) or int code (0 Unknown, 1 Male, 2 Female)

getLastname() str

Get lastname attribute of the current SisypheIdentity instance.

Returns

str

patient lastname

getParent() SisypheVolume

Get parent of the current SisypheIdentity instance.

Returns

Sisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent

hasParent() bool

Check whether current SisypheIdentity instance has a parent (Sisyphe.core.sisypheVolume.SisypheVolume instance), i.e. parent attribute is not None.

Returns

bool

True if current SisypheIdentity has parent

isAnonymized() bool

Check whether identity attributes of the current SisypheIdentity instance are anonymized.

Returns

bool

True if identity attributes are anonymized

isEqual(buff: SisypheIdentity) bool

Check that the attributes of the SisypheIdentity parameter are equal to those of the current SisypheIdentity instance. Attribute comparison order: lastname, firstname, birthdate, gender

Parameters

buffSisypheIdentity

identity to compare

Returns

bool

True if same identity

isFemale() bool

Check whether current SisypheIdentity instance gender attribute is female.

Returns

bool

True if patient is female

isMale() bool

Check whether current SisypheIdentity instance gender attribute is male.

Returns

bool

True if patient is male

isNotEqual(buff: SisypheIdentity) bool

Check that the attributes of the SisypheIdentity parameter are not equal to those of the current SisypheIdentity instance. Attribute comparison order: lastname, firstname, birthdate, gender

Parameters

buffSisypheIdentity

identity to compare

Returns

bool

True if different identity

isOlder(buff: SisypheIdentity | date | int | float) bool

Check whether current SisypheIdentity instance age calculated from birthdate attribute is younger than age calculated from parameter.

Parameters

buffSisypheIdentity | datetime.date | int | float

birthdate

Returns

bool

True if older

isYounger(buff: SisypheIdentity | date | int | float) bool

Check whether current SisypheIdentity instance age calculated from birthdate attribute is younger than age calculated from parameter.

Parameters

buffSisypheIdentity | datetime.date | int | float

birthdate

Returns

bool

True if younger

loadFromTxt(filename: str) None

Load current SisypheIdentity instance attributes from text file (.txt).

Parameters

filenamestr

text file name

loadFromXML(filename: str) None

Load current SisypheIdentity instance attributes from xml file (.xidentity).

Parameters

filenamestr

xml file name (.xidentity)

parseXML(doc: Document) None

Read current SisypheIdentity instance attributes from xml instance.

Parameters

docminidom.Document

xml document

saveToTxt(filename: str) None

Save current SisypheIdentity instance to text file (.txt).

Parameters

filenamestr

text file name

saveToXML(filename: str) None

Save current SisypheIdentity instance attributes to xml file (.xidentity).

Parameters

filenamestr

xml file name (.xidentity)

setAge(age: int, acqdate: date | str | None = None, f: str = '%Y-%m-%d') None

Set birthdate of the current SisypheIdentity instance using an age parameter (in years).

Parameters

ageint

age to be set

acqdatedatetime.date | str | None

acquisition date, today by default if None

fstr

date format used for acquisition date conversion if given as str (default ‘YYYY-MM-DD’)

setDateOfBirthday(buff: date | str | None = None, f: str = '%Y-%m-%d') None

Set birthdate attribute of the current SisypheIdentity instance.

Parameters

buffstr | datetime.date | None

patient birthdate as str or datetime.date, if None set default date

fstr

format used to convert date to str (default ‘%Y-%m-%d’)

setFirstname(buff: str) None

Set firstname attribute of the current SisypheIdentity instance.

Parameters

buffstr

patient firstname

setGender(v: int | str) None

Set gender attribute of the current SisypheIdentity instance.

Parameters

vstr | int

patient gender as str (‘Unknown’, ‘Male’, ‘Female’) or int code (0 Unknown, 1 Male, 2 Female)

setGenderToFemale() None

Set gender attribute of the current SisypheIdentity instance to female.

setGenderToMale() None

Set gender attribute of the current SisypheIdentity instance to male.

setGenderToUnknown() None

Set gender attribute of the current SisypheIdentity instance to unknown.

setLastname(buff: str) None

Set lastname attribute of the current SisypheIdentity instance.

Parameters

buffstr

patient lastname

setParent(parent: SisypheVolume) None

Set parent of the current SisypheIdentity instance.

Parameters

parentSisyphe.core.sisypheVolume.SisypheVolume

Sisyphe.core.sisypheVolume.SisypheVolume parent