Skip to content

InVesalius 3 Project file format

Thiago Franco de Moraes edited this page Jan 16, 2024 · 6 revisions

InVesalius 3 Project file format

Specification

InVesalius 3 project file is a tar file or tar.gz if compressed with .inv3 extension. Inside the .inv3 there is a folder (this folder can have any name). Inside this folder there is the main.plist file with the project informations. It's a XML Plist file. This is a dictionary like with this informations:

  • format_version (string): format version, the current version is 1.1

  • invesalius_version (string): version of the invesalius used to save the file

  • date (string): date and time when the file was save in ISO format

  • compress (bool): indicates if the file was compressed or not

  • name (string): patient name

  • modality (string): image modality, can be MR or CT

  • orientation (integer): image orientation where (see https://en.wikipedia.org/wiki/Anatomical_plane):

    • AXIAL = 1
    • CORONAL = 2
    • SAGITAL = 3
  • window_level (float): window center used in the visualization. See https://kevalnagda.github.io/ct-windowing

  • window_width (float): window width used in the visualization. See https://kevalnagda.github.io/ct-windowing

  • scalar_range (array integer): two numbers indicating the minimum and maximum value in the image

  • spacing (array float): indicates the size of the image voxels in X, Y and Z direction

  • affine (4x4 float array): affine matrix used to map from image to space in Nifti images (it is null in DICOM images)

  • matrix (dictionary): it's a dictionary with image informations. Theses are the keys:

  • masks (dictionary): it's a dictionary where the key is the mask index and value is the plist with the mask information

  • measurements (string): plist file that contains measures info. For default this file is name 'measurements.plist',

  • surfaces (dictionary): it's a dictionary where the keys is the surface index and value is the plist with the surface information

  • annotations (dictionary): currently this is not used.

The mask plist file contains these informations:

  • index (integer): mask index inside the project
  • name (string): mask name
  • colour (array 3 floats): Mask RGB color where each value ranges from 0.0 to 1.0.
  • edited (bool): indicates if the mask was edited. This is needed because the surface generation from an edited to non-edited mask is different. If the mask was generated only from threshold this value is false. If other segmentation technique was used this value is true.
  • edition_threshold_range (array 2 integer): indicates the threshold used in edition in this mask
  • mask_file (string): mask image file name inside the project
  • mask_shape (array 3 integer): mask image sizes in Z, Y and X dimension.
  • opacity (float): mask opacity. For default it's 0.4
  • threshold_range (array 2 integer): indicates the threshold used in this mask
  • visible (bool): indicates if the mask is visible. Only one mask can be visible

The surface plist file contains these informations:

  • index(integer): surface index inside the project
  • name (string): surface name
  • colour(array 3 floats): surface RGB color where each value ranges from 0.0 to 1.0
  • area (float): surface area
  • volume (float): surface volume
  • polydata (string): file name in VTP format (VTK polydata).
  • transparency (float): surface transparency
  • visible (bool): indicates if the surface is visible

The image and mask images are numpy.memmap files. The order of indexing is Z, Y, X. Masks images have the same dimension size of the image added 1. For example if the image have the dimension <128, 255, 255> (Z, Y, X) then the mask images will have <128, 256, 256>.

Sample

main.plist

{
'format_version': 1.1,
'invesalius_version': '3.1.99998',
'date': '2024-01-12T12:18:18.354243',
'compress': False,

'name': 'InVesaliuus MRI T1',
'modality': 'MR',
'orientation': 3,
'window_level': 178.277075381679,
'window_width': 309.990458015267
'scalar_range': [0, 3826],
'spacing': [0.9992523193359943, 1.0, 1.0],
'affine': '',

'matrix': {
    'dtype': 'int16',
    'filename': 'matrix.dat',
    'shape': [256, 256, 180]
},

'masks': {
    '0': 'mask_0.plist'
},

'measurements': 'measurements.plist',

'surfaces': {
    '0': 'surface_0.plist'
},

'annotations': {},
}

mask_0.plist

{
 'index': 0,
 'name': 'Máscara 1',
 'colour': [0.33, 1, 0.33],
 'edited': True,
 'edition_threshold_range': [0, 3826],
 'mask_file': 'mask_0.dat',
 'mask_shape': [257, 257, 181],
 'opacity': 0.4,
 'threshold_range': [226, 3071],
 'visible': True
}

surface_0.plist

{
 'index': 0,
 'name': 'Superfície 1',
 'colour': [0.33, 1, 0.33],
 'area': 78623.33429300462,
 'polydata': 'surface_0.vtp',
 'transparency': 0.0,
 'visible': True,
 'volume': 1291923.597585425
}