Documentation/Labs/Surface Toolbox update

From Slicer Wiki
Jump to: navigation, search
Home < Documentation < Labs < Surface Toolbox update


Overview

As part of the SALT project we would like to revamp some of the existing functionality in MeshMath into the SurfaceToolbox. We will be hiring a summer intern to work on this over a couple of months this summer.

Team

  • JC Fillon-Robin
  • Bea Paniagua
  • Jared Vicory
  • Andras Lasso
  • TBD engineer

Definitions

  • KWMeshVisu: Legacy mesh viewer from the Styner Lab.
  • Types of Mesh Operations:
    • Multiple Mesh (2+)
    • Single Mesh
    • MeshToVolume
    • MeshScalar to Mesh
    • MeshScalar to MeshScalar
    • MeshScalar Operation

Initial discussions

We will be potentially implementing individual CLIs for each functionality in MeshMath, and those will be plugged into the Surface Toolbox.

Current MeshMath functionality

Name Description Type Keep Note
subtract Subtract mesh from inputmesh, write a KWMeshVisu readable text file PairWiseMesh X mark.png This functionality is currently available through ModelToModelDistance
magnitude Magnitude of the input metaArray file (mvh/mva) and writes a KWMeshVisu readable file ? X mark.png It seems this is very specific to a certain application
scaleMVA Scales the input metaArray file (mvh/mva) and writes a KWMeshVisu readable file ? X mark.png It seems this is very specific to a certain application
scaleMesh Scales the input mesh file SingleMesh Check.svg
avgMesh Compute the average mesh from inputmesh file1, file2... MultipleMesh Check.svg
ave Compute the average vector field from file1, file2... generated with -substract MultipleMesh / ScalarMesh Operator Check.svg Turn into a new MeshScalar operator. Given several Meshes with MeshScalars that are named the same way, it will allow averaging them and creating a new scalar map.
normave Works as the \"-ave\" option, but the average vector are projected on the normal at each point MultipleMesh / ScalarMesh Operator Check.svg Turn into a new MeshScalar operator. Given several Meshes with MeshScalars that are named the same way, it will allow averaging them and creating a new scalar map.
InvVect Invert all the vectors created with the -substract option and write a KWMeshVisu readable file MeshScalar Operation Check.svg
magdir Compute the signed magnitude of each of the vector from the vector field.(+ if in the normal direction, - otherwise) SingleMesh X mark.png This functionality is currently available through ModelToModelDistance
magNormdir Compute the signed magnitude of the normal projection of the vector field SingleMesh X mark.png This functionality is currently available through ModelToModelDistance
applyVec Deforme the mesh according to the vector field specified as input SingleMesh Check.svg
meshValues Find the points and cells in a mesh. The outputfile is a textfile with the values SingleMesh Check.svg Export through CSV
avgGaussMesh <Meshfile1> <Meshfile2> ... -gaussMeshPara <mean>,<stdev>,<val1>,<val2>,... Compute the gaussian average for mesh files. The first parameter is the average, then the standard deviation of the Gaussian model and the rest are the values associated with the files MultipleMesh Check.svg
avgGaussKWM Compute the gaussian average for KWMeshVisu files. The first parameter is the average, then the standard deviation of the Gaussian model and the rest are the values associated with the files MeshScalar Operation Check.svg See "ave"
alignMesh Align all of the meshes to the inputmesh (== MeshFile0) using Procrustes alignment [-scalingOn] MultipleMesh Check.svg Fix the scaling, give an option to export the scaling factors associated with the mesh (so it can be reverted via scaleMesh)
alignMeshICP Align all of the meshes to the inputmesh (== MeshFile0) using IterativeClosestPoints (no correspondence required) MultipleMesh Check.svg


   <<
   " -alignMesh <Meshfile1> <Meshfile2>...  "
   << endl;
   //bp 2016
   std::cout
   <<
   " -alignMeshICP <Meshfile1> <Meshfile2>...  "
   << endl;
   //bp 2016
   std::cout << " -BadTriangle <thresh value> [-correctMesh correctFilename] "  << std::endl;
   std::cout
   <<
   "  Find the bad triangles in a Mesh. The <thresh value> is the value of the threshFactor to calculate the standard deviation for the bad triangles. The output is a KWMeshVisu text file with the values of the average of the triangles of the mesh "
   << std::endl;
   std::cout << "  To have a new Mesh with the correct triangles -correctMesh " <<  std::endl;
   std::cout << " -extraction extractFilename [-extractClosest] [-nn]" << std::endl;
   std::cout
   <<
   "  To extract an attribute.The Input is the Mesh, the extractFilename is the attribute image and the Output is a KWMeshVisu text file with the attribute extraction"
   << std::endl;
   std::cout << "  [-extractClosest]: extract closest attribute" << std::endl;
   std::cout << "  [-nn]: nearest neighbor interpolation (default: linear)" << std::endl;
   std::cout << " -value <file1> <file2>... " << std::endl;
   std::cout
   << "  Extract the 5th column from a textfile and write a KWMeshVisu file with the values obtained"
   <<  std::endl;
   std::cout << " -subKWM <textname>       Difference between 2 KWMeshVisu files" << std::endl;
   std::cout
   <<
   " -MaxColor <textfile>...  Compare each point in every files, find a max for every points, keep 5% near the max, the other values will be 0"
   << std::endl;
   std::cout
   <<
   " -dist_absolute <textfile>,<textfile>...  -result_absolute <textfile>,<textfile>... Absolute distance map between KWMeshVisu files"
   << std::endl;
   std::cout
   <<
   " -dist_relative <textfile>,<textfile>...  -result_relative <textfile>,<textfile>... Relative distance map between KWMeshVisu files (values between -1 & 1)"
   << std::endl;
   std::cout << " -label <textfile>      Separate every labels, find the mean..." << std::endl;
   std::cout
   << " -color -val <number_of_label>,<value_label>... -oldval <number_of_old_label>,<old_value_label>..."
   << std::endl;
   std::cout << "  To change the value of labels to see the evolution with KWMeshVisu. " <<  std::endl;
   std::cout << "  Value_label is when the label grow up. " <<  std::endl;
   std::cout << "  Old_value_label is for the label wich has already grown up." <<  std::endl;
   std::cout
   << " -first <textfile>...   Convert a column file into a line file with a comma between each value"
   << std::endl;
   // cchou MC2Origin
   std::cout << " -MC2Origin       Translate the Center of Mass to the Origin" << std::endl;
   // bp2009 StatsKWM
   std::cout << " -avgOneKWM       Computes the avg of an input KWMeshVisu readable file" << std::endl;
   std::cout << " -medianOneKWM    Computes the min of an input KWMeshVisu readable file" << std::endl;
   std::cout << " -minOneKWM       Computes the min of an input KWMeshVisu readable file" << std::endl;
   std::cout << " -maxOneKWM       Computes the max of an input KWMeshVisu readable file" << std::endl;
   std::cout << " -per1OneKWM      Computes the 1% percentile of an input KWMeshVisu readable file" << std::endl;
   std::cout << " -per99OneKWM     Computes the 99% percentile of an input KWMeshVisu readable file" << std::endl;
   // bp2009 StatsKWM
   // bp2009 FillHole
   std::cout << " -FillHole        Fills up a hole in a open mesh." << std::endl;
   std::cout << "      If more than one hole exists, this operation might have to be repeated."
     << std::endl;
   // bp2009 FillHole
   // bp2009 BordersOut
   std::cout << " -BordersOut      Outputs the borders of a mesh (if there)." << std::endl;
   // bp2009 BordersOut
   // bp2009 IsOpen
   std::cout << " -IsOpen          Gives back an integer defining whether the mesh is open or not" << std::endl;
   // bp2009 IsOpen
   // bp2009 CleanMesh
   std::cout
   << " -CleanMesh       Re-mesh the input mesh and gives back a new clean mesh without degenerated triangles"
   << std::endl;
   // bp2009 CleanMesh
   // bp2009 SmoothMesh
   std::cout << " -SmoothMesh iterations    Gives back a Laplacian smoothed surface" << std::endl;
   std::cout << "          Iterations defines how many times the Laplacian is applied."
     << std::endl;
   // bp2009 SmoothMesh
   // bp2009 FilterNormals
   std::cout
   <<
   " -FilterNormals direction <MeshFileVTK> <MeshFileVTKOut>  ... Changes homogeneously normals of the polygons in a mesh"
   << std::endl;
   std::cout
   <<
   "               direction= [1] normals outwards [-1] normals inwards"
   << std::endl;
   // bp2009 FilterNormals
   // bp2009 StatsROI
   std::cout << " -statsROI <txtROIFileIn>   Process a KWMeshVisu file, given a ROI Mask" << std::endl;
   std::cout << "       Outputs a new KWMeshVisu only with the info in the mask"
     << std::endl;
   // bp2009 StatsROI
   // bp2009 KWMtoPolyData
   std::cout
   <<
   " -KWMtoPolyData <txtFileIn> <nameScalarField>   Writes a KWM scalar field (N Dimensions) into a PolyData Field Data Scalar to visualize in Slicer"
   << std::endl;
   // bp2009 KWMtoPolyData
   std::cout
   <<
   " -FSAscData <FreeSurferASCIIfile> <nameScalarField>   Extracts a curvature/thickness etc information from a FreeSurfer style scalar file and adds it as attribute to the vtk mesh for visualization. FS format is line-by-line, no header, with each line 'point-id vertex-x vertex-y vertex-z scalar-prop' "
   << std::endl;
   // styner2015 FSAscData
   std::cout << " -significanceLevel <double> the min Pvalue for the Pval ColorMap " << std::endl;
   // bp2009 ProcessROI
   std::cout << " -processROI <txtROIFileIn> <MeshFileIn>  ... [TEMP - do not know where to put this]" << std::endl;
   std::cout << "   Gets stats for a distances ROI map" << std::endl;
   // bp2009 ProcessROI
   std::cout << " -surfaceArea <AttributeFile>   Computes surface area in a txt file" << std::endl;
   std::cout << " -lobarSurfaceArea <ParcellationAttributeFile>   Computes lobar surface area (output: csv file)"<<std::endl;
   std::cout << " -variance <AttributeFile2> <AttributeFile3>...   Compute variance across population" << std::endl;
   // bp2010 GetCurvatures
   std::cout
   <<
   " -GetCurvatures <txtFileOut_C> <txtFileOut_S> <txtFileOut_Gauss> <txtFileOut_mean>... Gets an assorted set of curvature measurements:"
   << std::endl;
   std::cout
   <<
   "   Koenderink curvature values for an input mesh (shape index = S, curvedness = C), Gaussian Curvature and Mean Curvature"
   << std::endl;
   // bp2010 GetCurvatures
   // bp2010 particleConsistency
   std::cout
   <<
   " -particleConsistency <vtkFileIn_1> <lptsFileIn_1> ... <vtkFileIn_n> <lptsFileIn_n> ... Generates new particle files where fliped particles does not appear"
   << std::endl;
   // bp2010 particleConsistency
   // bp2010 GetDirectionFeatures
   std::cout
   <<
   " -GetDirectionFeatures ... Generates three KWM loadable files that have directionality features with respect to X, Y and Z directions"
   << std::endl;
   // bp2010 GetDirectionFeatures
   std::cout
   <<
   " -closestPoint <InputAttributeFile1> <InputMesh2>   Computes interpolated attribute file (output file) for second mesh using closest point interpolation between two input meshes"
   << std::endl;
   std::cout << " -extractVertices <YLocationAttributeFile.txt> <ZLocationAttributeFile.txt>  Extract points and write 3 different files listing respectively X, Y and Z values"
   << std::endl;
   std::cout << " -mean <AttributeFile2> <AttributeFile3>... Compute mean scalar attribute file (assuming same number of vertices)" << std::endl;
   //cx2011 cart2bary
   std::cout << " -cart2bary <vtkPointFileIn> Project each point in <vtkPointFileIn> onto the <inputmesh> and then calculate the Barycentric coordinate of the projected point, output to <OutputFileName>" << std::endl;
   //bp2011
   std::cout << " -attSTD <attribute_file2> <attribute_file2> ...<attribute_fileN> ... Compute std for a collection of vector or scalar files" << std::endl;
   std::cout << " -VTKtolpts  ... Create a particle file out of a triangulated VTK mesh" << std::endl;
   //bp2012
   std::cout << " -relaxPolygons iterations... Mesh relaxation based in vtkWindowedSincPolyDataFilter" << std::endl;
   std::cout << " -decimateMesh <target reduction> ... Mesh decimation, reducing the number of points. Target reduction is a value from 0..1 that indicates in what % vertices should be reduced" << std::endl;
   //mst2013
   std::cout << " -listPointData    lists info about all the VTK point Data in the vtk file" << std::endl;
   std::cout << " -PointDataOp <name> <op> <val>   <name>: name of point data, " << std::endl

<< " <op>: [threshBelow | sub] threshBelow: set to 0 all data below <value>, sub: subtract value" << std::endl;

   //bp2013
   std::cout << " -translateMesh <tx_DimX> <tx_DimY> <tx_DimZ> ,  translates a mesh for a given amount " << std::endl;
   //bp2015
   std::cout << " -lookupPointData <csv_lookup> <scalar_field_name>,  substitutes scalar values in a given scalar field based on an input lookup " << std::endl;
   //bp2016
   std::cout << " -volumePolyData,  provides volume count for the PolyData through the std output. NOTE: Only in closed surfaces." << std::endl;
   
   std::cout << " -verbose                   Verbose output" << std::endl;
   return 0;
   }

Path forward

Testing data

TBD