morph package

Submodules

morph.morph module

class morph.morph.Morph(input_AF_stl_path: str, input_NP_stl_path: str, output_morphed_zip_path: str, input_lambdaBeta_csv_path: str | None = None, properties: dict | None = None, **kwargs)[source]

Bases: BiobbObject

biobb_morph Morph
The Morph class is designed for the production of 3DSpine meshes, from a template IVD mesh to a target, patient-personalized model.
The Morph class is designed for the production of 3DSpine meshes, from a template IVD mesh to a target, patient-personalized model. It supports various non-rigid registration modes and morphing operations to achieve optimal mesh alignment and transformation.
Parameters:
  • input_AF_stl_path (str) – Path to the AF stl input file path. File type: input. Sample file. Accepted formats: stl (edam:format_3993).

  • input_NP_stl_path (str) –

    Path to the NP stl input file path. File type: input. Sample file. Accepted formats: stl (edam:format_3993).

  • input_lambdaBeta_csv_path (str) (Optional) –

    Path to the csv lambdaBeta input file path. File type: input. Sample file. Accepted formats: csv (edam:format_3752).

  • output_morphed_zip_path (str) –

    Path to the output morphed zip file path. File type: output. Sample file. Accepted formats: zip (edam:format_3752).

  • properties (dict - Python dictionary object containing the tool parameters, not input/output files) –

    • morph (int) - (5) Non-Rigid registration mode. Options: 1: AF, 2: NP, 3: NoBEP, 4: CEPmorph, 5: All, 0: NONE.

    • toINP (int) - (4) Create the .inp file for specific components. Options: 1: AF, 2: NP, 3: NoBEP, 4: All, 0: NONE.

    • abaqusCommand (str) - (“gmsh”) Command used to call ABAQUS. If ‘-a gmsh’, the Gmsh tool is used.

    • bcpdCommand (str) - (“bcpd”) Command used to call BCPD++.

    • checkFElem (int) - (2) Check failed elements of the resulting .inp file (Abaqus required). Options: 1: YES, 2: Iterate value of lambda, 0: NO.

    • rigid (int) - (1) Perform rigid registration at the beginning of the process. Options: 1: YES, 0: NO.

    • WCEP (int) - (0) Perform morphing with CEP. Options: 1: YES, 0: NO.

    • interpo (int) - (1) Use interpolated files. Options: 1: YES, 0: NO.

    • fusion (int) - (1) Fuse the AF and NP for the final morph. Options: 1: YES, 0: NO.

    • surfRegCEP (int) - (1) Morph external surfaces of AF and NP (including CEP). Options: 1: YES, 0: NO.

    • checkHaus (int) - (1) Check Hausdorff distance between 3D grids (Euclidean distance). Options: 1: YES, 0: NO.

    • CEP (int) - (0) Perform non-rigid registration of the CEP. Options: 1: YES, 0: NO.

    • TZ (int) - (1) Create a Transition Zone. Options: 1: YES, 0: NO.

    • movement (list) - ([0, 0, 0.05]) Enter a list of floats separated by spaces to represent desired movement. Positive: positive direction, Negative: negative direction, 0: no movement.

    • nodeDistance (float) - (0.3) Distance between two nodes of the mesh.

    • moveTo (list) - ([0.0, 24.1397991, 2.94929004]) Translation of the AF and NP.

    • plane (list) - ([1, 1, 0]) Plane to orthogonally project the nodes of the NP to create the spline line of the perimeter.

    • reduce_param (float) - (0.8) Parameter to reduce the size of the contour of the NP.

Examples

This is a use example of how to use the building block from Python:

from biobb_morph.morph.morph import morph

prop = {
    'morph: 5
}
morph(input_AF_stl_path='/path/to/AF.stl',
      input_NP_stl_path='/path/to/NP.stl',
      output_morphd_zip_path='/path/to/morphed.zip',
      properties=prop)
Info:
launch() int[source]

Execute the Morph object.

morph.morph.main()[source]
morph.morph.morph(input_AF_stl_path: str, input_NP_stl_path: str, output_morphed_zip_path: str, input_lambdaBeta_csv_path: str | None = None, properties: dict | None = None, **kwargs) int[source]

Create Morph class and execute the launch() method.