Usage¶
Examples of batch usage¶
You can find simple working examples under the /examples folder. Parameters used are defined in params.txt for each example.
Example 1:
python main.py -b --path "./examples/ex1_letters/input"
--format "image" --n_interp 60 --z_size 90.0
--target_faces 50000 --sampling_factor 0.1
--min_mesh_size 5.0 --max_mesh_size 5.0
--output_dir "./examples/ex1_letters/output" --export_vtk
formatreader Module¶
Code containing all functions related to format reading and mask obtention
Functions¶
|
OpenCV implementation to obtain the contours present in the slice. |
|
From a 3D array containing the semgentation and the list of slices, it creates a set of interpolated slices between each pair of adjacent real slices using the sliceinterpolator module. |
|
Dilates the image to capture the external contour afterwards. |
|
Retrieves the largest connected component in a 3D volume (biggest separated object). |
|
Calls the corresponding function depending on the file format selected and retrieves its outputs. |
|
Retrieves the surface points of the 3D volume defined by the masks of a DICOM seg file. |
|
Retrieves the surface points of the 3D volume defined by a DICOM file. |
|
Retrieves the surface points of the 3D volume defined in multiple individual images. |
|
Retrieves the surface points of the 3D volume defined by a NIfTI file. |
|
Read numbers in a filename. |
|
Label connected regions of an integer array. |
|
Smooths the input image via erosion/dilation operations. |
|
Transforms the coordinates in voxel CSYS to real world, using the transformation matrix generated using the get_val_pos() function. |
formatwriter Module¶
Code containing all functions related to format writing (stl, gsmh mesh, ansys)
Functions¶
|
Generates a 3D FE mesh using linear tetrahedrons from a 3D .stl file using the GMSH library. |
|
Creates a 3D STL object from a given 3D point cloud using the pymeshlab library. |
|
Exports the given mesh data (nodes and connectivity) as a compatible ANSYS input file. |
|
Exports the given mesh data (nodes and connectivity) as a compatible ANSYS input file. |
sliceinterpolator Module¶
Code with utilities to interpolate coordinates between two countours
Functions¶
|
Find euclidean distance map of image |
|
Find the perimeter of objects in binary images. |
|
Exact Euclidean distance transform. |
|
Multidimensional interpolation on regular or rectilinear grids. |
|
Find interpolated shape at specific position between top and bottom |
|
Same as calling numpy |
|
Find perim and return masked image (signed/reversed) |
visualization Module¶
Code with utilities to visualize (e.g. point clouds)
Functions¶
|
Call in a loop to create terminal progress bar |
|
Shows point cloud in 3D |