Difference between revisions of "CRTC I2M"

From crtc.cs.odu.edu
Jump to: navigation, search
Line 3: Line 3:
  
 
-----
 
-----
This page contains instructions for downloading and using the CNF_tools suite developed at [CRTC lab](https://cepm.cs.odu.edu/Main_Page)  in [Old Dominion University](https://odu.edu/compsci) in collaboration with Jefferson Lab.
+
__TOC__
  
This project corresponds to Proposal No.: *CNF19-04 (FEMT-002)*
 
  
A short presentation can be found [here](__DOCUMENT0__)
+
-----
  
 +
This page contains instructions for downloading and using the CNF_tools suite developed at [https://cepm.cs.odu.edu/Main_Page CRTC lab] in [https://odu.edu/compsci Old Dominion University] in collaboration with Jefferson Lab.
  
The main component of the software suite is a 3D tessellation software called **PODM** capable of generating unstructured tetrahedral meshes out of 3D structured data.
+
This project corresponds to Proposal No.: ''CNF19-04 (FEMT-002)''
  
The output meshes are in the [VTK format](https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf) and can be visualized using the opensource software [Paraview](https://www.paraview.org). A short video demo exploring the data can be found [here](http://www.cs.odu.edu/crtc/videos/paraview.html).
+
A short presentation can be found [http://www.cs.odu.edu/crtc/cnf_project/assets/Imaging_Chrisochoides_ODU_04_30_19.pdf here]
  
## Requirements
+
The main component of the software suite is a 3D tessellation software called '''PODM''' capable of generating unstructured tetrahedral meshes out of 3D structured data.
 +
 
 +
The output meshes are in the [https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf VTK format] and can be visualized using the opensource software [https://www.paraview.org Paraview]. A short video demo exploring the data can be found [http://www.cs.odu.edu/crtc/videos/paraview.html here].
 +
 
 +
== Requirements ==
  
 
* OS: Linux, Windows 10 Pro/Enterprise, MacOS Sierra 10.12+
 
* OS: Linux, Windows 10 Pro/Enterprise, MacOS Sierra 10.12+
 
* Docker
 
* Docker
  
## Installing Docker
+
== Installing Docker ==
  
 
Official documentation :
 
Official documentation :
  
* [Microsoft Windows](https://docs.docker.com/docker-for-windows/install)
+
* [https://docs.docker.com/docker-for-windows/install Microsoft Windows]
* [MacOS](https://docs.docker.com/docker-for-mac/install/)
+
* [https://docs.docker.com/docker-for-mac/install/ MacOS]
 
* Linux
 
* Linux
    * [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
+
** [https://docs.docker.com/install/linux/docker-ce/ubuntu/ Ubuntu]
    * [Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
+
** [https://docs.docker.com/install/linux/docker-ce/debian/ Debian]
    * [CentOS](https://docs.docker.com/install/linux/docker-ce/centos/)
+
** [https://docs.docker.com/install/linux/docker-ce/centos/ CentOS]
    * [Other](https://docs.docker.com/install/linux/docker-ce/binaries)
+
** [https://docs.docker.com/install/linux/docker-ce/binaries Other]
  
### Note for Running on Windows
+
=== Note for Running on Windows ===
  
Docker on Windows uses Hyper-V VMs to run Linux containers.
+
Docker on Windows uses Hyper-V VMs to run Linux containers. By default, the spawned VMs use 2 vCPUs and 2 GB RAM.
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
+
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 tessellation tool (PODM) to to use more threads.
via the GUI to increase the resource allocation for the VMs in order
 
to allow the tessellation tool (PODM) to to use more threads.
 
  
## Getting the software
+
== Getting the software ==
  
The docker image is located [here](https://odu.box.com/s/sjt7y87q9saxjqovhi93l0ob5jg3tvv3) (restricted access).
+
The docker image is located [https://odu.box.com/s/sjt7y87q9saxjqovhi93l0ob5jg3tvv3 here] (restricted access).
  
## Docker Container Instructions
+
== Docker Container Instructions ==
  
1. Load the Docker Image.
+
<ol style="list-style-type: decimal;">
 +
<li><p>Load the Docker Image.</p>
 +
<p>First of all, the Docker image needs to be loaded. The following command must be used:</p>
 +
<pre>docker load --input [DOCKER_IMAGE_TAR]</pre>
 +
<p>Note: If the user is not in the <code>docker</code> group, prepending <code>sudo</code> to the above command is necessary.</p></li>
 +
<li><p>Running Currently the docker image includes three tools <code>tessellate2d</code>, <code>tessellate3d</code> and <code>convert_image</code> To use the tessellation tool use:</p></li></ol>
  
    First of all, the Docker image needs to be loaded.
+
<ul>
    The following command must be used:
+
<li><p>On MacOS/Linux</p>
 +
<pre>docker run -v $(pwd):/data/ cnf_tools &lt;application&gt; [arguments]</pre></li>
 +
<li><p>On Windows with Powershell (recommended)</p>
 +
<pre>docker run -v ${PWD}:/data/ cnf_tools &lt;application&gt; [arguments]</pre></li>
 +
<li><p>On Windows with command line (cmd)</p>
 +
<pre>docker run -v %cd%:/data/ cnf_tools &lt;application&gt; [arguments]</pre></li></ul>
  
      docker load --input [DOCKER_IMAGE_TAR]
+
Where <code>&lt;application&gt;</code> is one of the currently available tools : <code>tessellate2d</code> ,<code>tessellate3d</code> or <code>convert_image</code>.
  
    Note: If the user is not in the `docker` group, prepending `sudo` to the above command is necessary.
+
== Tessellation Parameters ==
  
2. Running
+
A quick way to view all available parameters and brief descriptions for them is to pass the <code>--help</code> flag to <code>tessellate2d</code>/<code>tessellate3d</code>.
Currently the docker image includes three tools `tessellate2d`, `tessellate3d` and `convert_image`
 
To use the tessellation tool use:
 
  
* On MacOS/Linux
+
Below are more detailed descriptions of the <code>tessellate</code> parameters:
 
 
      docker run -v $(pwd):/data/ cnf_tools <application> [arguments]
 
 
 
* On Windows with Powershell (recommended)
 
 
 
      docker run -v ${PWD}:/data/ cnf_tools <application> [arguments]
 
 
 
* On Windows with command line (cmd)
 
 
 
      docker run -v %cd%:/data/ cnf_tools <application> [arguments]
 
 
 
Where `<application>` is one of the currently available tools : `tessellate2d` ,`tessellate3d` or `convert_image`.
 
 
 
## Tessellation Parameters
 
 
 
A quick way to view all available parameters and
 
brief descriptions for them is to pass the `--help` flag to `tessellate2d`/`tessellate3d`.
 
 
 
Below are more detailed descriptions of the `tessellate` parameters:
 
  
 
The common parameters for both versions are :
 
The common parameters for both versions are :
  
`--input [filename] ` (required)
+
<code>--input [filename]</code> (required)
  
Input file (3D image). Can be in `nrrd` format.
+
Input file (3D image). Can be in <code>nrrd</code> format.
  
`--output [filename]` (optional)
+
<code>--output [filename]</code> (optional)
  
The filename of the output mesh. (default: `outputMesh.vtk`).
+
The filename of the output mesh. (default: <code>outputMesh.vtk</code>).
  
`--weight-limit [real]` (optional)
+
<code>--weight-limit [real]</code> (optional)
  
Set a weight limit for the generated elements that will be used from the sizing function (default: 0.1).
+
Set a weight limit for the generated elements that will be used from the sizing function (default: 0.1). This parameter acts as a limit for the relative difference of the weights for a sample of points within the element. It is designed to give some control on the discretization error with respect to the input data.
This parameter acts as a limit for the relative difference of the weights for a sample of points within the element. It is designed to give some control on the discretization error with respect to the input data.
 
  
`--min-edge [real]` (optional)
+
<code>--min-edge [real]</code> (optional)
  
Set the minimum edge size of generated elements that will be used for the sizing function (default: 1). It is designed to be used together with `weight-limit` controlling the size of the generated mesh.  
+
Set the minimum edge size of generated elements that will be used for the sizing function (default: 1). It is designed to be used together with <code>weight-limit</code> controlling the size of the generated mesh.
  
### Tessellate3D Specific Parameters
+
=== Tessellate3D Specific Parameters ===
  
`--delta [real] ` (required)
+
<code>--delta [real]</code> (required)
  
 
Controls the size of the elements nearby the boundary. Smaller values will lead to finer detail close to the boundary (and often to a more accurate mesh) but will also lead to a greater mesh size.
 
Controls the size of the elements nearby the boundary. Smaller values will lead to finer detail close to the boundary (and often to a more accurate mesh) but will also lead to a greater mesh size.
  
`--threads [int]` (optional)
+
<code>--threads [int]</code> (optional)
  
 
How many threads to use. (default: 1)
 
How many threads to use. (default: 1)
  
`--plc [filename]` (optional)
+
<code>--plc [filename]</code> (optional)
  
If given, the surface of the produced mesh will be saved into `filename` in the VTK format.
+
If given, the surface of the produced mesh will be saved into <code>filename</code> in the VTK format.
  
`--memory-limit [int in MB]` (optional)
+
<code>--memory-limit [int in MB]</code> (optional)
  
Constrain the amount of memory that will be used (default : 70% of the free memory).  
+
Constrain the amount of memory that will be used (default : 70% of the free memory).
  
`--verbose-level [0,1,2]` (optional)
+
<code>--verbose-level [0,1,2]</code> (optional)
  
Control the level of verbosity. 0 produces no text output while 2 enables extra information (default: 1).  
+
Control the level of verbosity. 0 produces no text output while 2 enables extra information (default: 1).
  
`--background-value [real]` (optional)
+
<code>--background-value [real]</code> (optional)
  
Which voxel value to treat as background value. If none is desired, enter a value that does not exists in the dataset. (default: +∞). In practice, a background value is a value that is ignored from the tessellation procedure. Regions of the tessellation corresponding to the background value will have no elements.
+
Which voxel value to treat as background value. If none is desired, enter a value that does not exists in the dataset. (default: +∞). In practice, a background value is a value that is ignored from the tessellation procedure. Regions of the tessellation corresponding to the background value will have no elements.
  
`--all-statistics` (optional)
+
<code>--all-statistics</code> (optional)
  
 
Output all statistics (thread and mesh).
 
Output all statistics (thread and mesh).
  
`--thread-statistics` (optional)
+
<code>--thread-statistics</code> (optional)
  
 
Output thread statistics.
 
Output thread statistics.
  
`--mesh-statistics` (optional)
+
<code>--mesh-statistics</code> (optional)
 +
 
 +
Output mesh statistics.
 +
 
 +
=== Tessellate2D Specific Parameters ===
 +
 
 +
<code>--verbose-level [0,1]</code> (optional)
 +
 
 +
Control the level of verbosity. 0 produces no text output while 1 produces the standard amount of information (default: 1). ## <code>convert_image</code> parameters
  
Output mesh statistics.  
+
<code>convert_image</code> serves as a utility to convert input data between different kinds of image formats. For example the <code>.nrrd</code> images acquired from Jefferson lab cannot be used with Paraview in order to create contour-plots (unknown why). However, converting them using
  
### Tessellate2D Specific Parameters
+
<pre>docker run -v $(pwd):/data/ cnf_tools convert_image input_image.nrrd output_image.vtk </pre>
 +
enables all relevant image filters in Paraview.
  
`--verbose-level [0,1]` (optional)
+
== Example Dataset ==
  
Control the level of verbosity. 0 produces no text output while 1 produces the standard amount of information (default: 1).
+
Example dataset can be found [https://crtc.cs.odu.edu/CNF:Example_Meshes here] (restricted access)
## `convert_image` parameters
 
  
`convert_image` serves as a utility to convert input data between different kinds of image formats.
+
Example dataset can be found [https://odu.box.com/s/ce6wc1ht1f96jx7lpafys1ue1piiyekc here] (restricted access)
For example the `.nrrd` images acquired from Jefferson lab cannot be used with Paraview in order to create contour-plots (unknown why).
 
However, converting them using
 
  
    docker run -v $(pwd):/data/ cnf_tools convert_image input_image.nrrd output_image.vtk
+
[[File:./assets/tesselate_example0.png]]
  
enables all relevant image filters in Paraview.
+
Generated using :
   
 
## Example Dataset
 
  
Example dataset can be found [here](https://crtc.cs.odu.edu/CNF:Example_Meshes) (restricted access)
+
<pre>docker run -v $(pwd):/data/ cnf_tools  tessellate --input ./CNF_SHARE/DATA_04252019/OBS_ALU.nrrd --delta 1 --output mesh0.vtk</pre>
 +
For the uniform case (up right)
  
 +
<pre>docker run -v $(pwd):/data/ cnf_tools tessellate --input ./CNF_SHARE/DATA_04252019/OBS_ALU.nrrd --delta 1 --output mesh1.vtk </pre>
 +
For the graded case (down right)
  
 
Example dataset can be found [https://odu.box.com/s/ce6wc1ht1f96jx7lpafys1ue1piiyekc here] (restricted access)
 
Example dataset can be found [https://odu.box.com/s/ce6wc1ht1f96jx7lpafys1ue1piiyekc here] (restricted access)

Revision as of 16:31, 11 November 2019





This page contains instructions for downloading and using the CNF_tools suite developed at CRTC lab in Old Dominion University in collaboration with Jefferson Lab.

This project corresponds to Proposal No.: CNF19-04 (FEMT-002)

A short presentation can be found here

The main component of the software suite is a 3D tessellation software called PODM 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 opensource software Paraview. A short video demo exploring the data can be found here.

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 tessellation tool (PODM) to to use more threads.

Getting the software

The docker image 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 Currently the docker image includes three tools tessellate2d, tessellate3d and convert_image To use the tessellation tool use:

  • On MacOS/Linux

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

    docker run -v ${PWD}:/data/ cnf_tools <application> [arguments]
  • On Windows with command line (cmd)

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

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

Tessellation Parameters

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

Below are more detailed descriptions of the tessellate parameters:

The common parameters for both versions are :

--input [filename] (required)

Input file (3D image). Can be in nrrd format.

--output [filename] (optional)

The filename of the output mesh. (default: outputMesh.vtk).

--weight-limit [real] (optional)

Set a weight limit for the generated elements that will be used from the sizing function (default: 0.1). This parameter acts as a limit for the relative difference of the weights for a sample of points within the element. It is designed to give some control on the discretization error with respect to the input data.

--min-edge [real] (optional)

Set the minimum edge size of generated elements that will be used for the sizing function (default: 1). It is designed to be used together with weight-limit controlling the size of the generated mesh.

Tessellate3D Specific Parameters

--delta [real] (required)

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

--threads [int] (optional)

How many threads to use. (default: 1)

--plc [filename] (optional)

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

--memory-limit [int in MB] (optional)

Constrain the amount of memory that will be used (default : 70% of the free memory).

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

Control the level of verbosity. 0 produces no text output while 2 enables extra information (default: 1).

--background-value [real] (optional)

Which voxel value to treat as background value. If none is desired, enter a value that does not exists in the dataset. (default: +∞). In practice, a background value is a value that is ignored from the tessellation procedure. Regions of the tessellation corresponding to the background value will have no elements.

--all-statistics (optional)

Output all statistics (thread and mesh).

--thread-statistics (optional)

Output thread statistics.

--mesh-statistics (optional)

Output mesh statistics.

Tessellate2D Specific Parameters

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

Control the level of verbosity. 0 produces no text output while 1 produces the standard amount of information (default: 1). ## convert_image parameters

convert_image serves as a utility to convert input data between different kinds of image formats. For example the .nrrd images acquired from Jefferson lab cannot be used with Paraview in order to create contour-plots (unknown why). However, converting them using

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

enables all relevant image filters in Paraview.

Example Dataset

Example dataset can be found here (restricted access)

Example dataset can be found here (restricted access)

[[File:./assets/tesselate_example0.png]]

Generated using :

docker run -v $(pwd):/data/ cnf_tools  tessellate --input ./CNF_SHARE/DATA_04252019/OBS_ALU.nrrd --delta 1 --output mesh0.vtk

For the uniform case (up right)

docker run -v $(pwd):/data/ cnf_tools tessellate --input ./CNF_SHARE/DATA_04252019/OBS_ALU.nrrd --delta 1 --output mesh1.vtk 

For the graded case (down right)

Example dataset can be found here (restricted access)

NT 140519.png

Generated using :

docker run -v $(pwd):/data/ cnf_tools  tessellate --input ./CNF_SHARE/CFF_14052019/NT_140519.nrrd --delta 6 --output mesh0.vtk