Difference between revisions of "CRTC I2M"

From crtc.cs.odu.edu
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 28: Line 28:
  
  
Input image and clipped generated meshes
+
* Input image (left figure): Dimensions (255x255x229) with spacing (0.976562x0.976562x1.40002)
 +
* Uniform mesh with delta = default (middle figure): 205,510 tetrahedra
 +
* Uniform mesh with delta = 1.5 (right figure): 767,393 tetrahedra
  
 
[[File:Head-Neck.png|1000px]]
 
[[File:Head-Neck.png|1000px]]
 
* Input (left figure): Dimensions (255x255x229) with spacing (0.976562x0.976562x1.40002)
 
* Uniform with Delta = default (middle figure): 205,510 tetrahedra
 
* Uniform with Delta = 1.5 (right figure): 767,393 tetrahedra
 
  
 
Uniform with Delta = default (middle figure):
 
Uniform with Delta = default (middle figure):
Line 55: Line 53:
 
<code>-o, --output [filename]</code> (optional)
 
<code>-o, --output [filename]</code> (optional)
  
The filename of the output mesh saved in VTK format. (Default: input filename + parameters.vtk).
+
The filename of the output mesh saved in VTK format.<br />
 +
(Default: input filename + parameters.vtk).
  
 
<code>-c, --plc [filename]</code> (optional)
 
<code>-c, --plc [filename]</code> (optional)
Line 64: Line 63:
  
 
Sets the number of threads to be utilized.<br />
 
Sets the number of threads to be utilized.<br />
(Default: 1).
+
(Default: 1).  
  
 
<code>-d, --delta [unsigned real]</code> (optional)
 
<code>-d, --delta [unsigned real]</code> (optional)
Line 94: Line 93:
  
  
Input image and clipped generated meshes
+
* Input image (left figure): Dimensions (100x100x100) with spacing (1x1x1), Voxels = 1,000,000
 +
* Uniform mesh (middle figure): 768,033 tetrahedra
 +
* Adaptive mesh (right figure): 257,041 tetrahedra
  
 
[[File:NT_3D.png|1000px]]
 
[[File:NT_3D.png|1000px]]
 
* Input (left figure): Dimensions (100x100x100) with spacing (1x1x1), Voxels = 1,000,000
 
* Uniform (middle figure): 768,033 tetrahedra
 
* Adaptive (right figure): 257,041 tetrahedra
 
  
 
Uniform (middle figure):
 
Uniform (middle figure):
Line 108: Line 105:
  
 
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./CNF_Data/3D/CFF_14052019/NT_140519.nrrd --cnf-adaptive --weight-limit 0.07</pre>
 
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./CNF_Data/3D/CFF_14052019/NT_140519.nrrd --cnf-adaptive --weight-limit 0.07</pre>
More Detailed 3D examples of Computational Nuclear Femtography can be found [https://crtc.cs.odu.edu/CNF_Example_Meshes#3D_Example_Meshes here].
+
More Detailed 3D examples of Computational Nuclear Femtography can be found [https://crtc.cs.odu.edu/CNF_Example_Meshes#3D_Example_Meshes here].  
  
 
==== Parameters ====
 
==== Parameters ====
Line 143: Line 140:
 
<code>--cnf-adaptive</code> (optional)
 
<code>--cnf-adaptive</code> (optional)
  
Produces adaptive meshes for CNF data. The level of adaptivity is controlled by <code>--weight-limit</code> and <code>--min-edge</code> (see below). For more details about how sizing works see the [[#note-sizing-function|note]] at the end of the section.
+
Produces adaptive meshes for CNF data. The level of adaptivity is controlled by <code>--weight-limit</code>, <code>--min-edge</code>, <code>--max-edge</code> (see below). The definition of the sizing function that is used to to generate adaptive meshes is described [[#note-sizing-function|here]].
  
 
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
 
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
Line 152: Line 149:
 
<code>-m, --min-edge [unsigned real [0.000001, 7.5]]</code> (optional)
 
<code>-m, --min-edge [unsigned real [0.000001, 7.5]]</code> (optional)
  
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element. (Default: ''1/ sqrt(3) %'').
+
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.<br />
 +
(Default: ''1/sqrt(3) %'').
  
 
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
 
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
  
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element. (Default: ''10 %'').
+
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.<br />
 +
(Default: ''10 %'').
  
 
<code>-b, --background-value [signed real]</code> (optional)
 
<code>-b, --background-value [signed real]</code> (optional)
Line 163: Line 162:
 
(Default: +oo).
 
(Default: +oo).
  
===== Note: Sizing Function =====
 
 
 
The input image is used as a background(BG) mesh while refining the mesh. Before the beginning of the refinement, the input image is analyzed, and the ''image-weight-range'' along with the diagonal of the image are computed, The diagonal is used to define the ''minimum-element-edge-length'' and ''maximum-element-edge-length'' multiplied by the the user-defined ''min-edge'' and ''max-edge'' diagonal percentages. The refinement algorithm queries the sizing function (SF) to verify whether each element satisfies the user constrains. Each time SF is called upon an element, it will check if it meets the size constrains ''minimum-element-edge-length'' and ''maximum-element-edge-size''. Consequently, it will create a set SP of sampling points out of the element. This set consists of the element’s vertices, barycenter, and midpoints of vertices and barycenter. The sampling points that are preserved out of SP are those that lie within the BG mesh. Using the BG mesh, a set V of the values of SP is created. Subsequently, the ''element-weight-range'' = abs(max(V) - min(V)) is evaluated. If ''element-weight-range''/''image-weight-range'' exceeds the user constraint ''weight-limit'', the element is split.
 
  
 
=== Tessellate2D ===
 
=== Tessellate2D ===
Line 173: Line 168:
  
  
Input image and generated meshes
+
* Input image (left figure) : Dimensions (100x100) with spacing (1x1), Pixels = 10,000
 +
* Uniform mesh (middle figure) : 7,587 triangles
 +
* Adaptive mesh (right figure) : 1,181 triangles
  
 
[[File:NT_2D.png|1000px]]
 
[[File:NT_2D.png|1000px]]
 
* Input (left figure) : Dimensions (100x100) with spacing (1x1), Pixels = 10,000
 
* Uniform (middle figure) : 7,587 triangles
 
* Adaptive (right figure) : 1,038 triangles
 
  
 
Uniform (middle figure):
 
Uniform (middle figure):
  
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --min-edge=2 --uniform</pre>
+
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --cnf-unfirom --area 2</pre>
 
Adaptive (right figure):
 
Adaptive (right figure):
  
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --min-edge=2 --weight-limit=0.1</pre>
+
<pre>docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --cnf-adaptive --min-edge 1</pre>
 
More Detailed 2D examples of Computational Nuclear Femtography can be found [https://crtc.cs.odu.edu/CNF_Example_Meshes#2D_Example_Meshes here].
 
More Detailed 2D examples of Computational Nuclear Femtography can be found [https://crtc.cs.odu.edu/CNF_Example_Meshes#2D_Example_Meshes here].
  
 
==== Parameters ====
 
==== Parameters ====
  
 
Note: For the description of the employed sizing function please see the software documentation section of [[#mesh-sizing-parameters|Tessellate3D]].
 
  
 
<code>-i, --input [filename]</code> (required)
 
<code>-i, --input [filename]</code> (required)
Line 201: Line 192:
  
 
The filename of the output mesh saved in VTK format.<br />
 
The filename of the output mesh saved in VTK format.<br />
(Default: <code>outputMesh.vtk</code>).
+
(Default: input filename + parameters.vtk).
 +
 
 +
<code>-a, --area [unsigned real]</code> (optional)
 +
 
 +
Sets maximum area of triangle.<br />
 +
(Default: 0.5)
 +
 
 +
<code>--cnf-uniform</code> (optional)
 +
 
 +
Produces uniform size meshes for CNF data. Size of elements is controlled by <code>--area</code>.
 +
 
 +
<code>--cnf-adaptive</code> (optional)
  
<code>-w,--weight-limit [unsigned real]</code> (optional)
+
Produces adaptive meshes for CNF data. The level of adaptivity is controlled by <code>--weight-limit</code>, <code>--min-edge</code>, <code>--max-edge</code> (see below). The definition of the sizing function that is used to to generate adaptive meshes is described [[#note-sizing-function|here]].
  
Sets the element weight limit for the generated elements that will be used by the sizing function. This parameter limits the difference among the weights within one element. It is designed to give some control of the discretization error with respect to the input data.<br />
+
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
(Default: 0.1)
 
  
<code>-e,--min-edge [unsigned real]</code> (optional)
+
Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.<br />
 +
(Default: 0.1).
  
Sets the minimum element edge size of the generated elements that will be used by the sizing function. It is designed to be used in conjunction with <code>--weight-limit</code> controlling the size of the generated mesh. Using <code>--min-edge</code> &lt; ''1'' does not offer significant gain if the ''pixel size'' of the input image = ''1''.
+
<code>-m, --min-edge [unsigned real [0.000001, 7.5]]</code> (optional)
  
''minimum-physical-size'' of input image = min(spacing * size).<br />
+
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.<br />
(Default: ''1 / 100'' * ''minimum-physical-size'')
+
(Default: ''1/sqrt(2) %'').
  
<code>-u,--uniform</code> (optional)
+
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
  
Creates a uniform mesh instead of an adaptive one. Uses <code>--min-edge</code> value as a constant size constraint.
+
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.<br />
 +
(Default: ''10'' * ''sqrt(2) %'').
  
 
= Software Documentation =
 
= Software Documentation =
Line 318: Line 321:
 
Constrains the amount of memory in MB that will be used.<br />
 
Constrains the amount of memory in MB that will be used.<br />
 
(Default: 80% of the free memory).
 
(Default: 80% of the free memory).
 +
 +
<code>--parallel-mesh-results</code> (optional)
 +
 +
Computes mesh results in parallel.
  
 
=== Geometry Parameters ===
 
=== Geometry Parameters ===
Line 358: Line 365:
 
<code>-f, --sizing-function</code> (optional)
 
<code>-f, --sizing-function</code> (optional)
  
Enables the sizing-function that is described below. Uses <code>--weight-limit</code> and <code>--min-edge</code> as optional parameters.<br />
+
Enables the sizing-function that is described [[#note-sizing-function|here]]. Uses <code>--weight-limit</code>, <code>--min-edge</code>, <code>--max-edge</code> as optional parameters.<br />
 
<code>--sizing-function</code> needs to be used in conjunction with <code>--volume-grading</code> so that the volume’s refinement will be mainly controlled by the sizing-function.
 
<code>--sizing-function</code> needs to be used in conjunction with <code>--volume-grading</code> so that the volume’s refinement will be mainly controlled by the sizing-function.
 
The input image is used as a background(BG) mesh while refining the mesh. Before the beginning of the refinement, the input image is analyzed, and the ''image-weight-range'' along with the diagonal of the image are computed, The diagonal is used to define the ''minimum-element-edge-length'' and ''maximum-element-edge-length'' multiplied by the the user-defined ''min-edge'' and ''max-edge'' diagonal percentages. The refinement algorithm queries the sizing function (SF) to verify whether each element satisfies the user constrains. Each time SF is called upon an element, it will check if it meets the size constrains ''minimum-element-edge-length'' and ''maximum-element-edge-size''. Consequently, it will create a set SP of sampling points out of the element. This set consists of the element’s vertices, barycenter, and midpoints of vertices and barycenter. The sampling points that are preserved out of SP are those that lie within the BG mesh. Using the BG mesh, a set V of the values of SP is created. Subsequently, the ''element-weight-range'' = abs(max(V) - min(V)) is evaluated. If ''element-weight-range''/''image-weight-range'' exceeds the user constraint ''weight-limit'', the element is split.
 
 
The described sizing function was designed for the Computational Nuclear Femtography data. Nonetheless, another sizing function could be designed and employed if requested.
 
  
 
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
 
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
Line 373: Line 376:
  
 
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.<br />
 
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.<br />
(Default: ''1/ sqrt(3) %'').
+
(Default: ''1/sqrt(3) %'').
  
 
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
 
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
Line 379: Line 382:
 
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.<br />
 
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.<br />
 
(Default: ''10 %'').
 
(Default: ''10 %'').
 +
 +
===== Note: Sizing Function =====
 +
 +
 +
The input image is used as a background(BG) mesh while refining the mesh. Before the beginning of the refinement, the input image is analyzed, and the ''image-weight-range'' along with the diagonal of the image are computed, The diagonal is used to define the ''minimum-element-edge-length'' and ''maximum-element-edge-length'' multiplied by the user-defined ''min-edge'' and ''max-edge'' diagonal percentages. The refinement algorithm queries the sizing function (SF) to verify whether each element satisfies the user constrains. Each time SF is called upon an element, it will check if it meets the size constrains ''minimum-element-edge-length'' and ''maximum-element-edge-size''. Consequently, it will create a set SP of sampling points out of the element. This set consists of the element’s vertices, barycenter, and midpoints of vertices and barycenter. The sampling points that are preserved out of SP are those that lie within the BG mesh. Using the BG mesh, a set V of the values of SP is created. Subsequently, the ''element-weight-range'' = abs(max(V) - min(V)) is evaluated. If ''element-weight-range'' / ''image-weight-range'' exceeds the user constraint ''weight-limit'', the element is split.
 +
 +
The described sizing function was designed for the Computational Nuclear Femtography data. Nonetheless, another sizing function could be designed and employed if requested.
  
 
=== Post-processing Parameters ===
 
=== Post-processing Parameters ===
Line 438: Line 448:
  
 
The filename of the output mesh saved in VTK format.<br />
 
The filename of the output mesh saved in VTK format.<br />
(Default: <code>outputMesh.vtk</code>).  
+
(Default: input filename + parameters.vtk).
  
 
<code>-r, --file-format {0,1}</code> (optional)
 
<code>-r, --file-format {0,1}</code> (optional)
Line 445: Line 455:
 
(Default: ASCII).
 
(Default: ASCII).
  
<code>-w,--weight-limit [unsigned real]</code> (optional)
+
<code>-f, --sizing-function</code> (optional)
 +
 
 +
Enables the sizing-function that is described [[#note-sizing-function|here]]. Uses <code>--weight-limit</code>, <code>--min-edge</code>, <code>--max-edge</code> as optional parameters.
  
Sets the element weight limit for the generated elements that will be used by the sizing function. This parameter limits the difference among the weights within one element. It is designed to give some control of the discretization error with respect to the input data.<br />
+
<code>-w, --weight-limit [unsigned real [0.000001, 1]]</code> (optional)
(Default: 0.1)
 
  
<code>-e,--min-edge [unsigned real]</code> (optional)
+
Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.<br />
 +
(Default: 0.1).
  
Sets the minimum element edge size of the generated elements that will be used by the sizing function. It is designed to be used in conjunction with <code>--weight-limit</code> controlling the size of the generated mesh. Using <code>--min-edge</code> &lt; ''1'' does not offer significant gain if the ''pixel size'' of the input image = ''1''.
+
<code>-m, --min-edge [unsigned real [0.000001, 7.5]]</code> (optional)
  
''minimum-physical-size'' of input image = min(spacing * size).<br />
+
Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.<br />
(Default: ''1 / 100'' * ''minimum-physical-size'')
+
(Default: ''1/sqrt(2) %'').
 +
 
 +
<code>-M, --max-edge [unsigned real [10.0, 50.0]]</code> (optional)
 +
 
 +
Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.<br />
 +
(Default: ''10'' * ''sqrt(2) %'').
 +
 
 +
<code>-l, --linear-interpolation</code> (optional)
 +
 
 +
Performs Linear Interpolation over the points of the produced mesh using the input image.
 +
 
 +
<code>--cnf-uniform</code> (optional)
  
<code>-u,--uniform</code> (optional)
+
Activates the flag <code>--linear-interpolation</code> which is required for producing uniform size meshes for CNF data. Size of elements is controlled by <code>--area</code>.
  
Creates a uniform mesh instead of an adaptive one. Uses <code>--min-edge</code> value as a constant size constraint.
+
<code>--cnf-adaptive</code> (optional)
 +
 
 +
Activates the flags <code>--sizing-function</code>, and <code>--linear-interpolation</code> which are required for producing adaptive meshes for CNF data. The level of adaptivity is controlled by <code>--weight-limit</code>, <code>--min-edge</code>, <code>--max-edge</code>.
  
 
<code>-v,--verbose-level [0,1]</code> (optional)
 
<code>-v,--verbose-level [0,1]</code> (optional)
Line 465: Line 490:
 
Controls the level of output text verbosity. <code>0</code> produces no output, and <code>1</code> produces standard output.<br />
 
Controls the level of output text verbosity. <code>0</code> produces no output, and <code>1</code> produces standard output.<br />
 
(Default: 1).
 
(Default: 1).
 +
  
 
== Convert Image ==
 
== Convert Image ==
Line 476: Line 502:
  
 
<pre>docker run -v $(pwd):/data/ crtc_i2m partonsToNRRD partonsFile.dat columnId xBins yBins zBins</pre>
 
<pre>docker run -v $(pwd):/data/ crtc_i2m partonsToNRRD partonsFile.dat columnId xBins yBins zBins</pre>
 
 
= Appendix =
 
= Appendix =
  

Latest revision as of 23:37, 23 July 2020



Introduction

This document contains instructions for downloading and using the crtc_i2m software suite developed by the CRTC lab at Old Dominion University.

The suite contains three software components:

  1. Tessellate3D (PODM 3D) (3D tessellation software)
  2. Tessellate2D (Triangle) (2D tessellation software)
  3. Convert Image (image format conversion software)
  4. PartonsToNRRD (creation of image out of Partons data software)

Problem Domains

The image-to-mesh conversion software suite that the CRTC has developed can be used in many different problem domains such as Medical Image Computing and Computational Nuclear Femtography. Specific instructions on how to use the software are described below.

Medical Image Computing

Tessellate3D

In Medical Image Computing, Tessellate3D can be used to generate meshes from multi-tissue segmented images.

Examples

  • Input image (left figure): Dimensions (255x255x229) with spacing (0.976562x0.976562x1.40002)
  • Uniform mesh with delta = default (middle figure): 205,510 tetrahedra
  • Uniform mesh with delta = 1.5 (right figure): 767,393 tetrahedra

Head-Neck.png

Uniform with Delta = default (middle figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./Medical_Imaging_Data/3D/Head-Neck.mha --output ./Head-Neck,d=2.49023.vtk

Uniform with Delta = 1.5 (right figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./Medical_Imaging_Data/3D/Head-Neck.mha --delta 1.5 -output ./Head-Neck,d=1.5.vtk

More Detailed 3D examples of Medical Image Computing can be found here.

Parameters

In this domain, some of the parameters of Tessellate3D take on different meanings. For the full range and descriptions of parameters please see the software documentation section of Tessellate3D.

-i, --input [filename] (required)

Input data. It could be an ASCII/Binary NRRD file, an image saved in .vtk format or any other format supported by the ITK library. For more information regarding the file formats supported by the ITK library, see here.

-o, --output [filename] (optional)

The filename of the output mesh saved in VTK format.
(Default: input filename + parameters.vtk).

-c, --plc [filename] (optional)

If given, the surface of the produced mesh will be saved into filename in the VTK format.

-t, --threads [unsigned integer] (optional)

Sets the number of threads to be utilized.
(Default: 1).

-d, --delta [unsigned real] (optional)

Controls the density of surface approximation. Smaller values will lead to denser approximation close to the surface (and often to a more accurate surface representation), but will also lead to greater mesh size. The same delta value is used for every tissue of interest. A smaller delta value should be used if at least one of the tissues of interest is not recovered after the Meshing Procedure.

The maximum suggested value for delta is 1 / 5 of the minimum-physical-size of the input image, where minimum-physical-size = min(spacing * size).
(Default: 1 / 100 * minimum-physical-size).

-g, --volume-grading (optional)

Enables the grading of the volume of the mesh. By default, the value of delta controls both the surface approximation and the size of the elements. Using this flag the value of delta will control only the surface approximation resulting in elements of higher volume inside the domain.

--include-labels [unsigned char list] (optional)

Labels that will be included in the mesh. If not specified, all labels will be included in the mesh. Cannot be used together with --exclude-labels.

--exclude-labels [unsigned char list] (optional)

Labels that will be excluded from the mesh. Keeps all labels in the mesh except the ones specified. If not specified, all labels will be included in the mesh. Cannot be used together with --include-labels.

Computational Nuclear Femtography

A short presentation can be found here.

Tessellate3D

Examples

  • Input image (left figure): Dimensions (100x100x100) with spacing (1x1x1), Voxels = 1,000,000
  • Uniform mesh (middle figure): 768,033 tetrahedra
  • Adaptive mesh (right figure): 257,041 tetrahedra

NT 3D.png

Uniform (middle figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./CNF_Data/3D/CFF_14052019/NT_140519.nrrd --cnf-uniform

Adaptive (right figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate3d --input ./CNF_Data/3D/CFF_14052019/NT_140519.nrrd --cnf-adaptive --weight-limit 0.07

More Detailed 3D examples of Computational Nuclear Femtography can be found here.

Parameters

In this domain, some of the parameters of Tessellate3D take on different meanings. For the full range and descriptions of parameters please see the software documentation section of Tessellate3D.

-i, --input [filename] (required)

Input data. It could be an ASCII/Binary NRRD file, an image saved in .vtk format or any other format supported by the ITK library. For more information regarding the file formats supported by the ITK library, see here.

-o, --output [filename] (optional)

The filename of the output mesh saved in VTK format.
(Default: input filename + parameters.vtk).

-t, --threads [unsigned integer] (optional)

Sets the number of threads to be utilized.
(Default: 1).

-d, --delta [unsigned real] (optional)

Controls the size of the elements near the boundary. Smaller values will lead to finer detail close to the boundary (and often to a more accurate boundary representation) but will also lead to a greater mesh size.

minimum-physical-size of input image = min(spacing * size).
(Default (if --cnf-uniform is specified): 1 / 100 * minimum-physical-size).
(Default (if --cnf-adaptive is specified): 1 / 20 * minimum-physical-size).

--cnf-uniform (optional)

Produces uniform size meshes for CNF data. Size of elements is controlled by --delta.

--cnf-adaptive (optional)

Produces adaptive meshes for CNF data. The level of adaptivity is controlled by --weight-limit, --min-edge, --max-edge (see below). The definition of the sizing function that is used to to generate adaptive meshes is described here.

-w, --weight-limit [unsigned real [0.000001, 1]] (optional)

Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.
(Default: 0.1).

-m, --min-edge [unsigned real [0.000001, 7.5]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.
(Default: 1/sqrt(3) %).

-M, --max-edge [unsigned real [10.0, 50.0]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.
(Default: 10 %).

-b, --background-value [signed real] (optional)

Sets the voxel value that will be treated as a background value during the image segmentation. If none is desired, enter a value that does not exist in the dataset. In practice, a background value is a value that is ignored by the tessellation procedure. Regions of the tessellation corresponding to the background value will have no elements.
(Default: +oo).


Tessellate2D

Examples

  • Input image (left figure) : Dimensions (100x100) with spacing (1x1), Pixels = 10,000
  • Uniform mesh (middle figure) : 7,587 triangles
  • Adaptive mesh (right figure) : 1,181 triangles

NT 2D.png

Uniform (middle figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --cnf-unfirom --area 2

Adaptive (right figure):

docker run -v $(pwd):/data/ crtc_i2m tessellate2d  --input ./CNF_Data/2D/NT_140519_50_X.vtk --cnf-adaptive --min-edge 1

More Detailed 2D examples of Computational Nuclear Femtography can be found here.

Parameters

-i, --input [filename] (required)

Input data. It could be an ASCII/Binary NRRD file, an image saved in .vtk format or any other format supported by the ITK library. For more information regarding the file formats supported by the ITK library, see here.

-o, --output [filename] (optional)

The filename of the output mesh saved in VTK format.
(Default: input filename + parameters.vtk).

-a, --area [unsigned real] (optional)

Sets maximum area of triangle.
(Default: 0.5)

--cnf-uniform (optional)

Produces uniform size meshes for CNF data. Size of elements is controlled by --area.

--cnf-adaptive (optional)

Produces adaptive meshes for CNF data. The level of adaptivity is controlled by --weight-limit, --min-edge, --max-edge (see below). The definition of the sizing function that is used to to generate adaptive meshes is described here.

-w, --weight-limit [unsigned real [0.000001, 1]] (optional)

Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.
(Default: 0.1).

-m, --min-edge [unsigned real [0.000001, 7.5]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.
(Default: 1/sqrt(2) %).

-M, --max-edge [unsigned real [10.0, 50.0]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.
(Default: 10 * sqrt(2) %).

Software Documentation

The CRTC’s image-to-mesh software suite has been packaged into a Docker image for easy distribution and portability across multiple platforms. All that is needed to use it is an OS supporting Docker.

Requirements

  • OS: Linux, Windows 10 Pro/Enterprise, MacOS Sierra 10.12+
  • Docker

Installing Docker

Official documentation :

Note for Running on Windows

Docker on Windows uses Hyper-V VMs to run Linux containers. By default, the spawned VMs use 2 vCPUs and 2 GB RAM.

If performance is a concern, it is recommended to edit the Docker settings via the GUI to increase the resource allocation for the VMs in order to allow the tessellation3D tool to use more threads.

Getting The Software

The docker image containing the crtc_i2m software suite is located here (restricted access).

Docker Container Instructions

  1. Load the Docker Image.

    First of all, the Docker image needs to be loaded. The following command must be used:

    docker load --input [DOCKER_IMAGE_TAR]

    Note: If the user is not in the docker group, prepending sudo to the above command is necessary.

  2. Running

    • On MacOS/Linux

      docker run -v $(pwd):/data/ crtc_i2m <application> [arguments]
    • On Windows with PowerShell (recommended)

      docker run -v ${PWD}:/data/ crtc_i2m <application> [arguments]

    Notice that in this case brackets {} are used instead of parenthesis ()

    • On Windows with the command line (cmd)

      docker run -v %cd%:/data/ crtc_i2m <application> [arguments]

Where <application> is one of the currently available tools : tessellate3d, tessellate2d, convert_image or partonsToNRRD.

Tessellate3D (PODM 3D)

The main component of the software suite is a 3D tessellation software called PODM3D, which is a parallel Image-to-Mesh conversion algorithm with quality and fidelity guarantees and is capable of generating unstructured tetrahedral meshes out of 3D structured data.

The output meshes are in the VTK format and can be visualized using the open-source software Paraview.

A quick way to view all available parameters and brief descriptions for them is to pass the -h, --help flag to tessellate3d.

Below is the detailed information about the parameters of tessellate3d:

I/O Parameters

-i, --input [filename] (required)

Input data. It could be an ASCII/Binary NRRD file, an image saved in .vtk format or any other format supported by the ITK library. For more information regarding the file formats supported by the ITK library, see here.

-o, --output [filename] (optional)

The filename of the output mesh saved in VTK format.
(Default: input filename + parameters.vtk).

-c, --plc [filename] (optional)

If given, the surface of the produced mesh will be saved into filename in the VTK format.

-r, --file-format {0,1} (optional)

Sets file format of outputFiles. 0 for ASCII, and 1 for BINARY.
(Default: BINARY).

Performance Parameters

-t, --threads [unsigned integer] (optional)

Sets the number of threads to be utilized. The upper bound of the number of threads that should be utilized is equal to the number of cores that you have. If the number of threads is greater than 1, the produced meshes may differ in terms of the number of elements up to 3% due to the nature of the employed parallelism technique.
(Default: 1).

-p, --thread-pinning {0, 1} (optional)

Controls the pinning of threads to cores. 0 doesn’t pin threads to cores (experimental), and 1 pins threads to cores.
(Default: 1).

--memory-limit [unsinged integer in MB] (optional)

Constrains the amount of memory in MB that will be used.
(Default: 80% of the free memory).

--parallel-mesh-results (optional)

Computes mesh results in parallel.

Geometry Parameters

-d, --delta [unsigned real] (optional)

Controls the density of surface approximation. Smaller values will lead to denser approximation close to the surface (and often to a more accurate surface representation), but will also lead to greater mesh size. The same delta value is used for every tissue of interest. A smaller delta value should be used if at least one of the tissues of interest is not recovered after the Meshing Procedure. For uniform meshes (i.e. no --volume-grading), the total number of elements is related to delta through an inverse cubic law (approximately):

The maximum suggested value for delta is 1 / 5 of the minimum-physical-size of the input image, where minimum-physical-size = min(spacing * size).
(Default (if --sizing-function is not specified): 1 / 100 * minimum-physical-size).
(Default (if --sizing-function is specified): 1 / 20 * minimum-physical-size).

Delta is an essential parameter that is involved in every step of the PODM algorithm and guarantees the quality and fidelity of the produced mesh. If using d_1 creates N_1 elements then d_1/2 will create (approximately) 8 = 2^3 times more elements while 2 * d_1 will generate 1/8N_1 elements. A table which shows the relation between delta and mesh size can be found in the Appendix. For more information on how delta affects the density of the sampling, see Guaranteed Quality Tetrahedral Delaunay Meshing for Medical Images.

-g, --volume-grading (optional)

Enables the grading of the volume of the mesh. By default, the value of delta controls both the surface approximation and the size of the elements. Using this flag the value of delta will control only the surface approximation resulting in elements of higher volume inside the domain.

Pre-processing Parameters

-s, --image-segmentation (optional)

Performs Image Segmentation on non-segmented/unlabeled images using a given background value. It should not be used for input images that are already segmented/labeled. Uses --background-value as an optional parameter.

-b, --background-value [signed real] (optional)

Sets the voxel value that will be treated as a background value during the image segmentation. If none is desired, enter a value that does not exist in the dataset. In practice, a background value is a value that is ignored by the tessellation procedure. Regions of the tessellation corresponding to the background value will have no elements.
(Default: +oo).

--include-labels [unsigned char list] (optional)

Labels that will be included in the mesh. If not specified, all labels will be included in the mesh. Cannot be used together with --exclude-labels.

--exclude-labels [unsigned char list] (optional)

Labels that will be excluded from the mesh. Keeps all labels in the mesh except the ones specified. If not specified, all labels will be included in the mesh. Cannot be used together with --include-labels.

Mesh Sizing Parameters

-f, --sizing-function (optional)

Enables the sizing-function that is described here. Uses --weight-limit, --min-edge, --max-edge as optional parameters.
--sizing-function needs to be used in conjunction with --volume-grading so that the volume’s refinement will be mainly controlled by the sizing-function.

-w, --weight-limit [unsigned real [0.000001, 1]] (optional)

Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.
(Default: 0.1).

-m, --min-edge [unsigned real [0.000001, 7.5]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.
(Default: 1/sqrt(3) %).

-M, --max-edge [unsigned real [10.0, 50.0]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.
(Default: 10 %).

Note: Sizing Function

The input image is used as a background(BG) mesh while refining the mesh. Before the beginning of the refinement, the input image is analyzed, and the image-weight-range along with the diagonal of the image are computed, The diagonal is used to define the minimum-element-edge-length and maximum-element-edge-length multiplied by the user-defined min-edge and max-edge diagonal percentages. The refinement algorithm queries the sizing function (SF) to verify whether each element satisfies the user constrains. Each time SF is called upon an element, it will check if it meets the size constrains minimum-element-edge-length and maximum-element-edge-size. Consequently, it will create a set SP of sampling points out of the element. This set consists of the element’s vertices, barycenter, and midpoints of vertices and barycenter. The sampling points that are preserved out of SP are those that lie within the BG mesh. Using the BG mesh, a set V of the values of SP is created. Subsequently, the element-weight-range = abs(max(V) - min(V)) is evaluated. If element-weight-range / image-weight-range exceeds the user constraint weight-limit, the element is split.

The described sizing function was designed for the Computational Nuclear Femtography data. Nonetheless, another sizing function could be designed and employed if requested.

Post-processing Parameters

-l, --linear-interpolation (optional)

Performs Linear Interpolation over the points of the produced mesh using the input image. It should not be used for input images that are already segmented/labeled.

Statistics Parameters

--thread-statistics (optional)

Computes and prints thread statistics.

--mesh-statistics (optional)

Computes and prints mesh statistics.

--all-statistics (optional)

Computes and prints all statistics (thread and mesh).

Special Parameters

--cnf-uniform (optional)

Activates the flags --image-segmentation, and --linear-interpolation which are required for producing uniform size meshes for CNF data. Size of elements is controlled by --delta.

--cnf-adaptive (optional)

Activates the flags --image-segmentation, --volume-grading, --sizing-function, and --linear-interpolation which are required for producing adaptive meshes for CNF data. The level of adaptivity is controlled by --weight-limit, --min-edge, --max-edge.

Miscellaneous Parameters

-v, --verbosity-level {0, 1, 2} (optional)

Controls the level of output text verbosity. 0 produces no output, 1 produces standard output, and 2 produces extensive output.
(Default: 1).

--version (optional)

Show PODM3D version and exit.

Tessellate2D (Triangle)

Tessellate2D is a modified version of the Triangle software for 2D tessellation.

The output meshes are in the VTK format and can be visualized using the open-source software Paraview.

Note: For the description of the employed sizing function please see the software documentation section of Tessellate3D.

Below is the detailed information about the parameters of tessellate2d:

-i, --input [filename] (required)

Input data. It could be an ASCII/Binary NRRD file, an image saved in .vtk format or any other format supported by the ITK library. For more information regarding the file formats supported by the ITK library, see here.

-o, --output [filename] (optional)

The filename of the output mesh saved in VTK format.
(Default: input filename + parameters.vtk).

-r, --file-format {0,1} (optional)

Sets file format of outputFiles. 0 for ASCII, and 1 for BINARY.
(Default: ASCII).

-f, --sizing-function (optional)

Enables the sizing-function that is described here. Uses --weight-limit, --min-edge, --max-edge as optional parameters.

-w, --weight-limit [unsigned real [0.000001, 1]] (optional)

Sets the element weight limit of the generated elements that will be used by the sizing function. Weight limit is used by the sizing function to control the gradation of the mesh based on the weights of the image.
(Default: 0.1).

-m, --min-edge [unsigned real [0.000001, 7.5]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the minimum edge of an element. Minimum edge is used by the sizing function to reject the refinement of an element.
(Default: 1/sqrt(2) %).

-M, --max-edge [unsigned real [10.0, 50.0]] (optional)

Sets the percentage of the diagonal of the box that will be used to define the maximum edge of an element. Minimum edge is used by the sizing function to approve the refinement of an element.
(Default: 10 * sqrt(2) %).

-l, --linear-interpolation (optional)

Performs Linear Interpolation over the points of the produced mesh using the input image.

--cnf-uniform (optional)

Activates the flag --linear-interpolation which is required for producing uniform size meshes for CNF data. Size of elements is controlled by --area.

--cnf-adaptive (optional)

Activates the flags --sizing-function, and --linear-interpolation which are required for producing adaptive meshes for CNF data. The level of adaptivity is controlled by --weight-limit, --min-edge, --max-edge.

-v,--verbose-level [0,1] (optional)

Controls the level of output text verbosity. 0 produces no output, and 1 produces standard output.
(Default: 1).


Convert Image

convert_image serves as a utility to convert input data between different types of image formats. It allows converting the input data between different image types supported by ITK enabling in some cases more post-processing filters in Paraview (e.g. contour plots). However, converting them using the following command enables all relevant image filters in Paraview.

docker run -v $(pwd):/data/ crtc_i2m convert_image input_image.nrrd output_image.vtk

Partons To NRRD

partonsToNRRD serves as a utility to create images out of partons data.

docker run -v $(pwd):/data/ crtc_i2m partonsToNRRD partonsFile.dat columnId xBins yBins zBins

Appendix

How mesh size relates to delta

Input Image: NT_140519.nrrd

  • The size of the input image is: (100x100x100)
  • Spacing of the input image: (1x1x1)
  • MinimumPhysicalSize = 100 * 1 = 100
  • Maximum suggested delta value is: 100 / 5 = 20
Delta # Vertices # Tetrahedra
20 147 430
10 563 1,780
5 2,686 10,210
2.5 13,366 56,274
1.25 79,086 401,610
0.625 520,538 2,922,427