Difference between revisions of "CRTC I2M"

From crtc.cs.odu.edu
Jump to: navigation, search
(Example Dataset)
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.
  
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.
+
This project corresponds to Proposal No.: *CNF19-04 (FEMT-002)*
  
This project corresponds to Proposal No.: ''CNF19-04 (FEMT-002)''
+
A short presentation can be found [here](__DOCUMENT0__)
  
A short presentation can be found [http://www.cs.odu.edu/crtc/cnf_project/assets/Imaging_Chrisochoides_ODU_04_30_19.pdf 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 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].
+
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).
  
== Requirements ==
+
## 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 :
  
* [https://docs.docker.com/docker-for-windows/install Microsoft Windows]
+
* [Microsoft Windows](https://docs.docker.com/docker-for-windows/install)
* [https://docs.docker.com/docker-for-mac/install/ MacOS]
+
* [MacOS](https://docs.docker.com/docker-for-mac/install/)
 
* Linux
 
* Linux
** [https://docs.docker.com/install/linux/docker-ce/ubuntu/ Ubuntu]
+
    * [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
** [https://docs.docker.com/install/linux/docker-ce/debian/ Debian]
+
    * [Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
** [https://docs.docker.com/install/linux/docker-ce/centos/ CentOS]
+
    * [CentOS](https://docs.docker.com/install/linux/docker-ce/centos/)
** [https://docs.docker.com/install/linux/docker-ce/binaries Other]
+
    * [Other](https://docs.docker.com/install/linux/docker-ce/binaries)
  
=== Note for Running on Windows ===
+
### 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.
+
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 to allow the tessellation tool (PODM) to use more threads.
+
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 ==
+
## Getting the software
  
The docker image is located [https://odu.box.com/s/sjt7y87q9saxjqovhi93l0ob5jg3tvv3 here] (restricted access).
+
The docker image is located [here](https://odu.box.com/s/sjt7y87q9saxjqovhi93l0ob5jg3tvv3) (restricted access).
  
== Docker Container Instructions ==
+
## Docker Container Instructions
  
<ol style="list-style-type: decimal;">
+
1. Load the Docker Image.
<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 two tools <code>tessellate</code> and <code>convert_image</code> To use the tessellation tool use:</p></li></ol>
 
  
<ul>
+
    First of all, the Docker image needs to be loaded.
<li><p>On MacOS/Linux</p>
+
    The following command must be used:
<pre>docker run -v $(pwd):/data/ cnf_tools tessellate [arguments]</pre></li>
 
<li><p>On Windows with Powershell (recommended)</p>
 
<pre>docker run -v ${PWD}:/data/ cnf_tools tessellate [arguments]</pre></li>
 
<li><p>On Windows with command line (cmd)</p>
 
<pre>docker run -v %cd%:/data/ cnf_tools tessellate [arguments]</pre></li></ul>
 
  
To use the convert_image tool replace <code>tessellate</code> with <code>convert_image</code> in the commands above
+
      docker load --input [DOCKER_IMAGE_TAR]
  
== Tessellation Parameters ==
+
    Note: If the user is not in the `docker` group, prepending `sudo` to the above command is necessary.
  
A quick way to view all available parameters and brief descriptions for them is to pass the <code>--help</code> flag to <code>tessellate</code>.
+
2. Running
 +
Currently the docker image includes three tools `tessellate2d`, `tessellate3d` and `convert_image`
 +
To use the tessellation tool use:
  
Below are more detailed descriptions of the <code>tessellate</code> parameters:
+
* On MacOS/Linux
  
<code>--input [filename]</code> (required)
+
      docker run -v $(pwd):/data/ cnf_tools <application> [arguments]
  
Input file (3D image). Can be in <code>nrrd</code> format.
+
* On Windows with Powershell (recommended)
  
<code>--delta [real]</code> (required)
+
      docker run -v ${PWD}:/data/ cnf_tools <application> [arguments]
  
Controls the size of the tetrahedrons. Smaller values will lead to finer detail (and often to a more accurate mesh) using more tetrahedrons but will also lead to a greater mesh size.
+
* On Windows with command line (cmd)
  
<code>--threads [int]</code> (optional)
+
      docker run -v %cd%:/data/ cnf_tools <application> [arguments]
  
How many threads to use.
+
Where `<application>` is one of the currently available tools : `tessellate2d` ,`tessellate3d` or `convert_image`.
  
<code>--output [filename]</code> (optional)
+
## Tessellation Parameters
  
The filename of the output mesh. Defaults to <code>outputMesh.vtk</code>.
+
A quick way to view all available parameters and
 +
brief descriptions for them is to pass the `--help` flag to `tessellate2d`/`tessellate3d`.
  
<code>--plc [filename]</code> (optional)
+
Below are more detailed descriptions of the `tessellate` parameters:
  
If given, the surface of the produced mesh will be saved into <code>filename</code> in the VTK format.
+
The common parameters for both versions are :
  
<code>--memory-limit [int in MB]</code> (optional)
+
`--input [filename] ` (required)
  
Constrain the amount of memory that will be used (default: 70% of the free memory).
+
Input file (3D image). Can be in `nrrd` format.
  
<code>--verbose-level [0,1,2]</code> (optional)
+
`--output [filename]` (optional)
  
Control the level of verbosity. 0 produces no text output while 2 enables extra information (default 1).
+
The filename of the output mesh. (default: `outputMesh.vtk`).
  
<code>--background-value [real]</code> (optional)
+
`--weight-limit [real]` (optional)
  
Which voxel value to treat as background value. If none is desired, enter a value that does not exist in the dataset. (default: +∞).
+
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. 
  
<code>--weight-limit [real]</code> (optional)
+
`--min-edge [real]` (optional)
  
Set the minimum edge size of the element that will be used from the sizing function (default 1).
+
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.  
  
<code>--min-edge [real]</code> (optional)
+
### Tessellate3D Specific Parameters
  
Set the weight limit of the element that will be used from the sizing function (default 0.1).
+
`--delta [real] ` (required)
  
<code>--all-statistics</code> (optional)
+
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).
 
Output all statistics (thread and mesh).
  
<code>--thread-statistics</code> (optional)
+
`--thread-statistics` (optional)
  
 
Output thread statistics.
 
Output thread statistics.
  
<code>--mesh-statistics</code> (optional)
+
`--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
  
Output mesh statistics.
+
Example dataset can be found [here](https://crtc.cs.odu.edu/CNF:Example_Meshes) (restricted access)
  
== Example Dataset ==
 
  
 
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](https://cepm.cs.odu.edu/Main_Page) in [Old Dominion University](https://odu.edu/compsci) in collaboration with Jefferson Lab.

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

A short presentation can be found [here](__DOCUMENT0__)


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](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).

    1. Requirements
  • OS: Linux, Windows 10 Pro/Enterprise, MacOS Sierra 10.12+
  • Docker
    1. Installing Docker

Official documentation :

   * [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
   * [Debian](https://docs.docker.com/install/linux/docker-ce/debian/)
   * [CentOS](https://docs.docker.com/install/linux/docker-ce/centos/)
   * [Other](https://docs.docker.com/install/linux/docker-ce/binaries)
      1. 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.

    1. Getting the software

The docker image is located [here](https://odu.box.com/s/sjt7y87q9saxjqovhi93l0ob5jg3tvv3) (restricted access).

    1. 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`.

    1. 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.

      1. 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.

      1. 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).

    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.

    1. Example Dataset

Example dataset can be found [here](https://crtc.cs.odu.edu/CNF:Example_Meshes) (restricted access)


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