DisPerSE - persistent structures identification - TutorialAutomatic identification of persistent structures in 2D or 3D.
keywords: Morse complex, topology, peak, void, source, wall, filament, cosmic web, cosmology, structure identification.2013-01-24T03:58:22+01:00thierry sousbieurn:md5:f62b3bf39b9948523836119476648bbfDotclearPoint sample: 3D walls and filamentsurn:md5:94d68b84101013d641d848c9a2d563b22320-05-09T06:59:00+01:002012-10-02T17:01:36+02:00thierry sousbieTutorial <p>This tutorial follows the 2D discrete case example introduced in the <a href="http://localhost/dotclear/index.php?post/Example-1">previous section</a> so you should probably read it first if you haven't done so yet.
<br /><br />
We will compute the filaments and walls from the downsampled dark matter N-body simulation snapshot <em>${DISPERSE}/data/simu_32_id.gad</em>. The distribution has periodic boundary conditions and we therefore start by computing its Delaunay tessellation with the following command:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">delaunay_3D simu_32_id.gad -periodic</div>
<p><br />
The program should output a file called <em>simu_32_id.gad.NDnet</em> that can be used directly with <a href="http://localhost/dotclear/index.php?post/mse">mse</a> to compute the filaments and walls of the distribution. In 3D, walls are represented by the <a href="http://localhost/dotclear/index.php?post/definitions">ascending 2-manifolds</a> that originate from critical points of critical index <em>1</em> so they can be computed with option <em><a href="http://localhost/dotclear/index.php?post/mse#dumpmanifolds">-dumpManifolds</a> JE1a</em> (letter <em>E</em> stands for <em>Extended</em>, which means that the ascending 1-manifolds and ascending 0-manifolds at the boundary of the walls will also be added, see option <em><a href="http://localhost/dotclear/index.php?post/mse#dumpmanifolds">-dumpManifolds</a></em> of <a href="http://localhost/dotclear/index.php?post/mse">mse</a>) .Note that by default, subsets of the walls that are common to several walls are merged together, so you may want to try <em>-dumpManifolds JP1a</em> instead if you are interested in studying the properties of individual walls. The filaments are computed with option <em><a href="http://localhost/dotclear/index.php?post/mse#upskl">-upSkl</a></em> or <em><a href="http://localhost/dotclear/index.php?post/mse#dumparcs">-dumparcs</a> U</em> which are equivalent. Using interactive mode to select a persistence threshold (use <em><a href="http://localhost/dotclear/index.php?post/mse#nsig">-nsig</a> 3.5</em> instead of <em><a href="http://localhost/dotclear/index.php?post/mse#interactive">-interactive</a></em> if <a href="http://localhost/dotclear/index.php?post/pdview">pdview</a> could not compile on your computer), we run the following command:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_32_id.gad.NDnet -dumpManifolds JE1a -upSkl -interactive</div>
<p><br />
which after some quick computations, should display the following persistence diagram.
<br /><br />
<img src="http://localhost/dotclear/public/per_diag_3D.jpg" alt="per_diag_3D.jpg" style="display:block; margin:0 auto;" />
<br />
On this diagram, each type of pair is represented by a mark of different color : blue for minima/1-saddle, green for 1-saddle/2-saddle and red for 2-saddle/maxima. Note that the blue dots in the lower left corner stand for the voids in the distribution, so it is expected that we find only few of them compared to the red dots which represent collapsed structure (the simulation is <em>50 Mpc</em> large). Each point on the diagram representing a topological feature, we would like to select only those points that stand out of the general distribution in terms of persistence in order to keep only the most meaningful structures (the persistence selection threshold is set by clicking while holding <em>Ctrl</em> key). The diagram suggests that persistence threshold should be above <em>~3-sigmas</em> so we select a threshold of <em>~3.5 sigmas</em> and click on the <em>done</em> button to confirm the selection. The program continues and should output the filaments in file <em>simu_32_id.gad.NDnet_s3.52.up.NDskl</em> and the walls in file <em>simu_32_id.gad.NDnet_s3.52_manifolds_JE1a.NDnet</em>.
<br /><br />
It is instructive at that point to read <a href="http://localhost/dotclear/index.php?post/mse">mse</a> output, and in particular the following section :
<br /><br /></p>
<pre>****** Simplifying complex ******
Starting Morse-Smale complex simplification.
Computing persistence pairs ... SKIPPED.
Sampling noise level was set to 3.5-sigma.
Cancelling pairs with persistance ratio < [2.66e+00,3.14e+00,4.42e+01].
Tagging arcs ... done.
Cancelling pairs (smart) ... (4140 rem.)
done.
Cancellation took 0.10s (4140 canceled, 1 conflicts, 10 loops).</pre>
<p><br /></p>
<p>what <em>mse</em> tells us here is that it successfully removed <em>4140</em> persistence pairs, but was not able to cancel <em>11</em> more although their persistence was lower than the threshold. The <em>10 loops</em> represent persistence pairs that were connected by more than one arc at the moment of their cancellation. Topologically speaking, their cancellation is not a valid operation as it would result in a discrete gradient loop (integral lines cannot form loops in <a href="http://localhost/dotclear/index.php?post/general-concepts">Morse-theory</a>). Note that the existence of non-cancellable pairs is not a bug of DisPerSE but rather a feature of Morse theory. However, not cancelling them may result in a few spurious non-significant pieces of filaments remaining in the ouput file (this is very problematic though as the impact on the identified filaments is very small in general) so one can use option <em><a href="http://localhost/dotclear/index.php?post/mse#forceloops">-forceLoops</a></em> to remove them anyway (which is perfectly fine if your goal is only to identify structures). Using this option will also solve the <em>1 conflict</em> identified by mse, as conflicts are the result of a non-cancellable pair blocking the cancellation of a valid cancellable pair.
<br /><br />
We can now rerun <em>mse</em> while skipping the computations by loading the backup file <em>simu_32_id.gad.NDnet.MSC</em> that mse generated on the previous run with option <em><a href="http://localhost/dotclear/index.php?post/mse#loadmsc">-loadMSC</a></em>:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_32_id.gad.NDnet -dumpManifolds JE1a -upSkl -forceLoops -loadMSC simu_32_id.gad.NDnet.MSC -nsig 3.52</div>
<p><br />
and the ouput should contain the following line:
<br /><br /></p>
<pre> Cancellation took 0.10s (4151 canceled, 0 conflicts, 11 forced loops).</pre>
<p><br />
indicating that all the <em>4151</em> non persistent pairs could be cancelled.
<br /><br />
We can now smooth and convert the resulting files to a more portable format:
<br /><br /></p>
<pre>skelconv simu_32_id.gad.NDnet_s3.52.up.NDskl -smooth 10 -to vtp
netconv simu_32_id.gad.NDnet -to vtu
netconv simu_32_id.gad.NDnet_s3.52_manifolds_JE1a.NDnet -smooth 10 -to vtu</pre>
<p><br /><a name="walls"></a>
and visualize the result with <a href="http://www.paraview.org/" title="paraview">paraview</a>. The configuration file <em>${DISPERSE}/data/simu_32_per.pvsm</em> can be directly loaded in paraview (<em>File->Load State</em>) to make the following plot: (note that it is a bit tricky to deal with periodic boundary conditions when visualizing, clipping the boundaries is usually the easiest way)
<br /><br />
<img src="http://localhost/dotclear/public/simu_3D_result_small.jpg" alt="simu_3D_result_small.jpg" style="display:block; margin:0 auto;" />
<br /><br />
<strong>Note</strong>: contrary to the previous example where we computed 2D voids (see <a href="http://localhost/dotclear/index.php?post/Example-1#voids">here</a>), it is problematic in this case to identify each individual wall and paint it with a specific color. Indeed, contrary to voids, the 2-manifolds that represent walls can overlap, and so a unique <em><a href="http://localhost/dotclear/index.php?post/networks#source">source_index</a></em> representing the critical point from which each wall originates cannot be assigned to each simplex (i.e. in that case, triangle). A solution to this problem would have been to specify that we wanted identical simplices to be stored as many times as they appear in different walls even though they are the same. This could have been achieved with flag <em>P</em> of option <em><a href="http://localhost/dotclear/index.php?post/mse#dumpmanifolds">-dumpManifolds</a></em> in <em>mse</em>:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_32_id.gad.NDnet -dumpManifolds JEP1a -upSkl -forceLoops -loadMSC simu_32_id.gad.NDnet.MSC -nsig 3.52</div>
<p><br />
As a result, the output file is larger, but it would also allow cross-linking the information contained in the geometry of the walls and that in the skeleton files or persistence pairs network (see this <a href="http://localhost/dotclear/index.php?post/Example-1#voids">note</a>).</p>Point sample: 2D voids and filamentsurn:md5:78ae47fc599db688f2e112bfcca6dce22310-05-09T06:59:00+01:002012-10-02T16:55:23+02:00thierry sousbieTutorial <p>This tutorial uses file <em>${DISPERSE}/data/simu_2D.ND</em> which contains the projected distribution of the particles in a slice of an N-Body dark matter simulation of a <em>50 Mpc</em> large chunk of the universe. Note that although we use a 2D slice for convenience here, the following procedure would also work with the full 3D distribution.
<br />
<br />
In this example, the voids and filaments of the particle distribution will be computed from the underlying density function traced by the particles, so we first need to define the topology of the space (i.e. we need a notion of neighborhood for each particle) and to estimate the density function. This is achieved using the Delaunay tessellation of the particle distribution, which can be computed with <em><a href="http://localhost/dotclear/index.php?post/Usage">delaunay_2D</a></em>.
<br />
<br />
The distribution of the particles is periodic, so we could simply run:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">delaunay_2D simu_2D.ND -periodic</div>
<p><br />
However, in this example we are going to pretend that the distribution has boundaries, which will make visualization easier (if boundary conditions are periodic, a filament crossing a boundary reappears on the other side, causing visual artifacts). We nevertheless would like to use the fact that boundary conditions are indeed periodic to correctly estimate density on the boundaries, which can be achieved using option <em><a href="http://localhost/dotclear/index.php?post/Usage#btype">-btype</a></em>:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">delaunay_2D simu_2D.ND -btype periodic</div>
<p><br />
The output file is named <em>simu_2D.ND.NDnet</em> by default, and it contains the Delauany tessellation as an <a href="http://localhost/dotclear/index.php?post/networks">unstructured network</a> in <a href="http://localhost/dotclear/index.php?post/NDnet-format">NDnet</a> format, as well as the density function estimated using DTFE at each vertex (i.e. the additional vertex data labeled <em>field_value</em> in the NDnet file). This file can be fed directly to <a href="http://localhost/dotclear/index.php?post/mse">mse</a>, but we have to choose a persistence threshold first.
<br />
<br />
Because the input file is a Delaunay tessellation, persistence is expressed as a ratio (density has a close to lognormal PDF) and the persistence threshold as a <em>number of sigmas</em> representing the probability that a persistence pair with given persistence ratio happens in a pure random discrete Poisson distribution. It is usually safe in such case to select a threshold between 2-sigmas and 4-sigmas, and we could directly compute the filaments of the distribution with the following command (see <a href="http://localhost/dotclear/index.php?post/mse">mse</a> for more info):
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_2D.ND.NDnet -nsig 3 -upSkl</div>
<p><br />
However, in this example, we will use a persistence diagram to decide the correct threshold (in case you do not have <a href="http://localhost/dotclear/index.php?post/pdview">pdview</a>, replace <em><a href="http://localhost/dotclear/index.php?post/mse#interactive">-interactive</a></em> with <em><a href="http://localhost/dotclear/index.php?post/mse#nsig">-nsig 3</a></em> in the following commannd) and we would also like to identify the voids in the distribution (i.e. the ascending 3-manifolds originating from critical points of critical index 0; see option <em><a href="http://localhost/dotclear/index.php?post/mse#dumpmanifolds">-dumpManifolds</a></em> of <a href="http://localhost/dotclear/index.php?post/mse">mse</a>):
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_2D.ND.NDnet -interactive -upSkl -dumpManifolds J0a</div>
<p><br />
After running this command line, you should be able to visualize the following diagrams:
<br /><br />
<img src="http://localhost/dotclear/public/per_diag_small.jpg" alt="per_diag_small.jpg" style="display:block; margin:0 auto;" />
<br />
On this picture, the maxima/saddle persistence pairs diagram is represented on the left and the minima/saddle one on the right. The fact that the second type of pairs are clearly less persistent reflects the known fact that dark matter haloes are very prominent structures because they belong to regions in the non linear regime where density increases exponentially fast. One nice feature of persistence diagrams is that they make it easy to choose the threshold above which underlying topological structures stand out of the noise : in the present case, we want to select the high persistence tails only that clearly stand out from the bunch of pairs generated by noise. This gives us a threshold of around <em>3-sigmas</em> that can be visually selected by clicking while holding <em>Ctrl</em> key down. Once the threshold is selected, simply press <em>Done</em> button.
<br />
<br />
After this operation, <a href="http://localhost/dotclear/index.php?post/mse">mse</a> should output two files: the filaments in a <a href="http://localhost/dotclear/index.php?post/skeleton-formats">skeleton type</a> file (<em>simu_2D.ND.NDnet_s3.up.NDskl</em>) and the voids in a <a href="http://localhost/dotclear/index.php?post/networks">network type</a> file (<em>simu_2D.ND.NDnet_s3_manifolds_J0a.NDnet</em>).
<br />
<br />
By default, <em>mse</em> associates maxima to vertices while minima are associated to d-<a href="http://localhost/dotclear/index.php?post/definitions">simplices</a> (where d is the dimension of space). As a result, the network representing the voids defines a set of triangles each associated to a given void. This may not be very practical for post-treatment or visualization, but we can use option <em><a href="http://localhost/dotclear/index.php?post/mse#vertexasminima">-vertexAsMinima</a></em> to reverse the convention (this will overwrite the previous file if the threshold is identical):
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse simu_2D.ND.NDnet -nsig 3 -vertexAsMinima -dumpManifolds J0a</div>
<p><br />
We can now visualize the result by converting the files to vtk formats using <a href="http://localhost/dotclear/index.php?post/skelconv">skelconv</a> and <a href="http://localhost/dotclear/index.php?post/netconv">netconv</a>. The skeleton is smoothed and converted to <em><a href="http://localhost/dotclear/index.php?post/vtk-formats">vtp</a></em> format:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">skelconv simu_2D.ND.NDnet_s3.up.NDskl -smooth 10 -to vtp</div>
<p><br />
and the input tesselation and output voids are converted to <em><a href="http://localhost/dotclear/index.php?post/vtk-network-format">vtu</a></em> format:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">
netconv simu_2D.ND.NDnet_s3_manifolds_J0a.NDnet -to vtu</br>
netconv simu_2D.ND.NDnet -to vtu
</div>
<p><br /><a name="voids"></a>
the result should look as follows when visualized with <em><a href="http://www.paraview.org/" title="paraview">paraview</a></em>: (the configuration file <em>${DISPERSE}/data/simu_2D_nonper.pvsm</em> can be directly loaded in paraview (<em>File->Load State</em>) to produce the following plot)
<br /><br />
<img src="http://localhost/dotclear/public/simu_2D_tuto_small.jpg" alt="simu_2D_tuto_small.jpg" style="display:block; margin:0 auto;" />
<br /><br />
<strong>Note</strong>: on the right figure, a different color is associated to the <em><a href="http://localhost/dotclear/index.php?post/networks#source">source_index</a></em> of each particle depending on which void it belongs to: each void originates from a different minimum of the field and each critical point has a specific index. This <em>source_index</em> corresponds to the position of this critical point as a node in skeleton files or as a vertex in persistence pair networks obtained with <a href="http://localhost/dotclear/index.php?post/mse">mse</a> (options <em><a href="http://localhost/dotclear/index.php?post/mse#dumparcs">-dumpArcs</a></em> and <em><a href="http://localhost/dotclear/index.php?post/mse#ppairs">-ppairs</a></em>). It can therefore also be used to cross-link information contained in manifold networks and skeletons or persistence pairs, such as for instance retrieving the hierarchy of the voids (i.e. using the <em><a href="http://localhost/dotclear/index.php?post/networks#parent">parent_index</a></em> of the critical points in <a href="http://localhost/dotclear/index.php?post/skeleton-formats#parent">skeleton files</a> and persistence pairs networks).</p>Persistence diagrams and filamentsurn:md5:e4ef47e75cc7c98d412cb709fd81079a2305-05-09T06:59:00+01:002012-07-11T20:36:28+02:00thierry sousbieTutorial <p>In this tutorial, we will identify the persistent filamentary structures in a diHydrogen column density map of the interstellar medium in the Eagle Nebula (M16) as observed by <a href="http://www.esa.int/herschel" title="herschel">Herschel</a> . The map is encoded in a 2D double precision FITS image, with pixels set to <em>NaN</em> in unobserved regions:
<br /><br />
<img src="http://localhost/dotclear/public/M16_blue.png" alt="M16_blue.png" style="display:block; margin:0 auto;" />
<br /><br />
By default, <a href="http://localhost/dotclear/index.php?post/mse">mse</a> will automatically mask NaN valued pixels so the FITS file could theoretically be fed directly to it. However, because of the complexity of the geometry of the observed region, it is preferable to use a mask to limit the analysis to a well defined region of interest (in particular, it is preferable that this region is simply connected - i.e. does not contain holes -). Designing a mask is relatively simple, as it consists in an image with pixels set to 0 in non-masked region and any other value in the masked regions (this behavior can be changed by adding a trailing '~' to the mask filename, see option <em><a href="http://localhost/dotclear/index.php?post/mse#mask">-mask</a></em>). The following mask was created with <em><a href="http://www.gimp.org/" title="gimp">Gimp</a></em> and saved as a <em>.PNG</em> file (any readable <a href="http://localhost/dotclear/index.php?post/field-formats">field file format</a> is acceptable):
<br /><br />
<img src="http://localhost/dotclear/public/M16_mask.png" alt="M16_mask.png" style="display:block; margin:0 auto;" />
<br /><br />
<br /><br />
With this mask, we can now use <em>mse</em> to identify the filamentary structures in the map (option <em><a href="http://localhost/dotclear/index.php?post/mse#upskl">-upSkl</a></em>) with the help of an interactive persitence diagram (option <em><a href="http://localhost/dotclear/index.php?post/mse#interactive">-interactive</a></em>) to select the correct persistent threshold as we do not want to impose any à-priori on its value. We therefore run the following command:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse m16_zo_no70um_density.fits -mask M16_mask.png -interactive -upSkl</div>
<p><br /><br />
After some computations, the following diagram should appear (use buttons <em>logX</em>/<em>logY</em> to switch logarithmic coordinate and buttons <em>1</em>, <em>2</em> and <em>3</em> to show/hide different types of persistence pairs):
<br /><br />
<img src="http://localhost/dotclear/public/M16_persistence_diagram_2.png" alt="M16_persistence_diagram_2.png" style="display:block; margin:0 auto;" />
<br /><br />
On this diagram, each dot represents a <a href="http://localhost/dotclear/index.php?post/definitions">persistence pair</a> of critical points (see <em><a href="http://localhost/dotclear/index.php?post/Persistence-and-simplification">overview</a></em> section), with its X coordinate being the value at the lowest critical point of the two (i.e. the <em>background</em> density) and its Y coordinate the persitence of the pair (i.e. the value difference between the two, interpreted as <em>contrast</em> of the topological feature it represents with respect to its background). Points located in the right side of this diagram represent features located in high valued regions of the map, while points in the upper side represent features that clearly stand out from their background. More specifically, the green squares stand for pairs of type <em>1</em> (i.e. saddle-point / maximum pairs) while blue disks stand for pairs of type <em>0</em> (i.e. minimum saddle-point pairs). This can be easily visualized on the following image, which represents a zoom on the map with critical points identified as blue squares, green crosses and red triangles for minima, saddle points and maxima respectively. On this plot, the identified filaments are represented in black, and each persistence pair of type <em>0</em> or <em>1</em> is represented as a blue or green segment linking its two critical points together (each segment corresponds to one point in the persistence diagram above):
<br /><br />
<img src="http://localhost/dotclear/public/M16_skel_nocut_ppairs_crit.png" alt="M16_skel_nocut_ppairs_crit.png" style="display:block; margin:0 auto;" />
<br /><br /></p>
<p>Basically, in 2D, removing a pair of type <em>0</em> (i.e. cancelling two critical points linked by a blue segment) amounts to deleting a piece of filament (i.e. 2 arcs departing from the saddle point) by merging two voids while removing a pair of type <em>1</em> (i.e. cancelling two critical points linked by a green segment) amounts to gluing pieces of filaments into longer ones (i.e. two arcs departing from the saddle point with one other arc departing from the maximum). When selecting the persistence threshold without à-priori, we therefore want to keep only the pairs that stand out of the general distribution on the Y-axis (i.e. with high persitence) so that only the most significant topological features remain. Selecting a threshold of <em>~4.2E21</em> as shown on the persistence diagram above seems quite reasonable (using <em>Ctrl+left Click</em>, and clicking on the <em>DONE</em> button to proceed).
<br /><br />
<a name="trim_exp"></a>
Visualizing a persistence diagram is a good way to determine the persistence threshold when assuming no previous knowledge of the data set. Note however that persistence could also have been set à-priori to the estimated amplitude of what is considered non-meaningful features or noise with option <em><a href="http://localhost/dotclear/index.php?post/mse#cut">-cut <val></a></em> instead of <em><a href="http://localhost/dotclear/index.php?post/mse#interactive">-interactive</a></em>. It is nonetheless always useful to check the persistence diagram as it deeply reflects the topological nature of the distribution and can be used to understand it better. For instance, the following diagram (represented by a 2D histogram of the pairs distribution, instead of the pairs themselves) was computed from a totally different map, and it is a good example:
<br /><br />
<img src="http://localhost/dotclear/public/ic5146_col_dens_pers_diag.png" alt="ic5146_col_dens_pers_diag.png" style="display:block; margin:0 auto;" />
<br /><br />
Indeed, from this diagram, not only can one learn that the persistence threshold should be <em>~6.E20</em> (from the Y-axis), but one can easily see that the nature of the distribution is different for background values below or above "X=~4E20" on the X-axis. This feature reflects the fact that in some regions of this data-set, the signal was below the instrument detection threshold and the result is complex noise generated by the detectors. Meaningful features may stand out from these regions, so it does not affect the choice of the persistence threshold. However, this tells us that any region with a value <em><4E20</em> cannot be considered signal and identified filaments should therefore be trimmed wherever the value is below this threshold (this can be achieved by running mse with a persitencce threhold of <em>6.E20</em> and then running the following command on the output skeleton file: <em><a href="http://localhost/dotclear/index.php?post/skelconv#trim">skelconv filaments.NDskl -trimBelow 4.E20</a></em>).
<br /><br />
Let us now come back to our example, where no such trimming is necessary. Selecting a persistence threshold of <em>~4.2E21</em> as discussed previously, we obtain the following filamentary structures :
<br /><br />
<img src="http://localhost/dotclear/public/M16_skel.png" alt="M16_skel.png" style="display:block; margin:0 auto;" />
<br /><br />
Remember that DisPerSE identifies structures as features of the <a href="http://localhost/dotclear/index.php?post/definitions">Morse-Smale complex</a>. The output of <em>mse</em> is <em>always</em> a valid (subset of the) Morse-Smale complex. In particular, filaments are identified as the set of <a href="http://localhost/dotclear/index.php?post/definitions">arcs</a> joining maxima and critical points, which means that pieces of filament always link a maximum and a critical point: they cannot stop in any other point, and whenever two filaments merge in points that are not maxima (i.e. bifurcation point), they remain distinct filaments until they reach a maximum (i.e. although they are not <em>visually</em> distinct as they are infinitely close, they are still stored as separate arcs in the output file). This is illustrated on the following figure, which shows a zoom on the identified filamentary structures with minima, saddle points and maxima represented as blue squares, green crosses and red triangles respectively:
<br /><br />
<img src="http://localhost/dotclear/public/M16_skel_nodes.png" alt="M16_skel_nodes.png" style="display:block; margin:0 auto;" />
<br /><br />
On this figure, individual pieces of filaments (i.e. arcs) link red triangles to green crosses, and several pieces of arcs may therefore overlap above bifurcation points. This is of course desirable for mathematical applications that require the computation of valid Morse-Smale complexes but can be problematic when one only needs to identify structures and measure their properties. Indeed, regions where several arcs overlap may accidentally be given a stronger weight in statistical analysis, biasing the results. One can fix this with the option <em><a href="http://localhost/dotclear/index.php?post/skelconv#breakdown">-breakdown</a></em> of <a href="http://localhost/dotclear/index.php?post/skelconv">skelconv</a> which is used to identify bifurcation points (adding them as dummy critical points of critical index <em>D+1</em>) and break filaments down into individual pieces of arcs.
<br /><br />
Another problem is the resolution of the filaments, which is roughly equal to that of the underlying map: filaments are described as sets of small segments linking neighbor pixels together in the oupout files of <em>mse</em>. As a result, they appear <em>jagged</em> on the previous image and they can locally only take a discrete set of orientation. Using option <em><a href="http://localhost/dotclear/index.php?post/skelconv#smooth">-smooth N</a></em> of <a href="http://localhost/dotclear/index.php?post/skelconv">skelconv</a>, one can fix this by ensuring their <em>smoothness</em> over a size of <em>~N pixels</em>. Note that only individual arcs or pieces of arcs are smoothed when using this option, critical points and bifurcation points remain fixed. As a result, the order of options <em><a href="http://localhost/dotclear/index.php?post/skelconv#smooth">-smooth</a></em> and <em><a href="http://localhost/dotclear/index.php?post/skelconv#breakdown">-breakdown</a></em> on the command line is important.
<br />
We choose to first smooth over ~6 pixels and then break the network down :
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">skelconv m16_zo_no70um_density.fits_c4.2e+21.up.NDskl -smooth 6 -breakdown</div>
<p><br /><br />
The result is illustrated on the following figure:
<br /><br />
<img src="http://localhost/dotclear/public/M16_skelBS_nodes.png" alt="M16_skelBS_nodes.png" style="display:block; margin:0 auto;" />
<br /><br />
where filaments are now smooth and bifurcation points are now identified as yellow discs : pieces of filament now link critical or bifurcation points and therefore do not overlap anymore.
<br /><br />
Although the resulting filaments are perfectly usable as such for analysis, other useful post-treatment are available in DisPerSE. We give in the following an example of their possible usage, but note that it should of course be adapted to the particular results one wants to obtain ...
<br /><br />
Options <em><a href="http://localhost/dotclear/index.php?post/skelconv#trim">-trimAbove</a></em> and <em><a href="http://localhost/dotclear/index.php?post/skelconv#trim">-trimBelow</a></em> for instance allow trimming portion of arcs so that they do not have to start/stop at critical or bifurcation points (dummy critical nodes are added at their extremities). By default, these options will trim the filaments above or below a given value of the field (see e.g. the example in the <a href="http://localhost/dotclear/index.php?post/regular-grid-%3A-filaments#trim_exp">section</a> on the persistence diagram above), but filaments can also be trimmed in any value tagged within the <a href="http://localhost/dotclear/index.php?post/skeleton-formats">skeleton file</a> (the list of the tags can be displayed by running <em><a href="http://localhost/dotclear/index.php?post/skelconv#info">skelconv filaments.NDskl -info</a></em> and arbitrary tags can be added with option <em><a href="http://localhost/dotclear/index.php?post/skelconv#addfield">-addField</a></em>).
<br /><br /><a name="robustness"></a>
A useful trimming function is <em><a href="http://localhost/dotclear/index.php?post/definitions#robustness">robustness</a></em> or <em>robustness_ratio</em>, which is not tagged by default in the <a href="http://localhost/dotclear/index.php?post/skeleton-formats">skeleton files</a> but can computed using option <em><a href="http://localhost/dotclear/index.php?post/mse#robustness">-robustness</a></em> of <em>mse</em> (you can use option <em><a href="http://localhost/dotclear/index.php?post/mse#loadmsc">-loadMSC</a></em> to avoid recomputing the whole Morse-Smale complex):
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">mse m16_zo_no70um_density.fits -mask M16_mask.png -cut 4.2E21 -upSkl -loadMSC m16_zo_no70um_density.fits.MSC</div>
<p><br /><br />
Robustness implements an improved version of the concept of <em>separatrix persistence</em> (Weinkauf, T. and Gunther, D., 2009) that allows the extension of regular <em>persistence</em> to each points of the filaments (as opposed to critical points pairs). Running the following command:
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">skelconv m16_zo_no70um_density.fits_c4.2e+21.up.NDskl -breakdown -smooth 6 -trimBelow robustness 8E21</div>
<p><br /><br />
one can select the most meaningful subset of the filaments (you can try several robustness thresholds to see the result, but the selected threshold should probably be greater than the persistence threshold). Note that the concepts of persistence and robustness are different, and robustness basically allows selecting those subsets of persistent (topological) filaments that are most prominent. For that reason, it may make sense when trimming on robustness criteria to lower the persistence threshold (in <em>mse</em>) so that the significant pieces of less persistent filaments can still be conserved (you should probably experiment in order to find the best compromise between persistence and robustness thresholds for a given type of data set).
In the present case, choosing a robustness threshold of 8E21 (i.e. slightly higher than the persistence threshold), one obtains the following filaments:
<br /><br />
<img src="http://localhost/dotclear/public/M16_skelBST_inc.png" alt="M16_skelBST_inc.png" style="display:block; margin:0 auto;" />
<br /><br /></p>
<p>Another interesting post-treatment is the option <em><a href="http://localhost/dotclear/index.php?post/skelconv#assemble">-assemble</a></em> that allows merging individual aligned pieces of filaments into larger structures. On the following picture, each piece of filament is represented with a distinct color:
<br /><br />
<img src="http://localhost/dotclear/public/M16_skelBST_nodes_fil.png" alt="M16_skelBST_nodes_fil.png" style="display:block; margin:0 auto;" />
<br /><br />
Running the following command (note once again that the order of arguments is important, try changing it ...):
<br /><br /></p>
<div style="text-align: center; border: 1px dotted gray;">skelconv m16_zo_no70um_density.fits_c4.2e+21.up.NDskl -breakdown -smooth 6 -trimBelow robustness 1.0E22 -assemble 70</div>
<p><br /><br />
one can assemble pieces of filaments that form an angle smaller than <em>70</em> degrees, resulting in the following structures, where individual pieces are straight but as long as possible:
<br /><br />
<img src="http://localhost/dotclear/public/M16_skelBSTA_nodes_fil.png" alt="M16_skelBSTA_nodes_fil.png" style="display:block; margin:0 auto;" />
<br /><br /></p>