diff --git a/ext_libs/iso2mesh/binscork.mexa64 b/ext_libs/iso2mesh/bin/cork.mexa64 similarity index 100% rename from ext_libs/iso2mesh/binscork.mexa64 rename to ext_libs/iso2mesh/bin/cork.mexa64 diff --git a/ext_libs/iso2mesh/binscork.mexmaci64 b/ext_libs/iso2mesh/bin/cork.mexmaci64 similarity index 100% rename from ext_libs/iso2mesh/binscork.mexmaci64 rename to ext_libs/iso2mesh/bin/cork.mexmaci64 diff --git a/ext_libs/iso2mesh/doc/Advanced_Features.txt b/ext_libs/iso2mesh/doc/Advanced_Features.txt deleted file mode 100755 index ff726d197..000000000 --- a/ext_libs/iso2mesh/doc/Advanced_Features.txt +++ /dev/null @@ -1,119 +0,0 @@ - #[1]iso2mesh: a Matlab/Octave-based mesh generator - -Advanced Features in iso2mesh - -Global variables - - ISO2MESH_TEMP - controls the temporary file output directory - - The default output directory is under the system's temporary directory, - i.e. the output of mwpath(''). However, if one does not have permission - to write to this folder, or if this contains outputs from other users - who shares the same output folder (for example, /tmp/iso2mesh-username - on Linux), one can avoid the permission error by setting his own output - folder. To do this, he need to define - ISO2MESH_TEMP='/folder/path/you/can/write'; - - in Matlab/Octave's "base workspace". The iso2mesh commands afterward - will output the intermediate files under the specified temp directory. - - ISO2MESH_SESSION - controls the output file name prefix - - If two users share a common output directory (for example /tmp for GNU - Linux) on a single machine, some of the users may not able to write - intermediate output files and encountered errors. If this happens, one - can set "ISO2MESH_TEMP" to define a new output folder, alternatively, - one can set ISO2MESH_SESSION to label all his output by a unique - prefix. For example, if one define - ISO2MESH_SESSION='foo_'; - - this will prepend 'foo_' to all output file names, if this string is - unique, users can produce all their output files without conflict with - other users. - - ISO2MESH_BIN - specifies the folder where to look for the external binaries - - There are several external tools are essential for iso2mesh. These - pre-compiled binaries are saved under iso2mesh/bin folder. In our - [2]Installation instructions, we ask the users to add this path to - their PATH environment variable. If user for some reason not be able to - do this, iso2mesh will do two things to look for these binaries: - 1. it will first check a global variable ISO2MESH_BIN and see if it is - defined in the 'base' workspace, if it is defined and the folder - exist, it will execute the binaries from that folder - 2. if no ISO2MESH_BIN defined, or it has a value which does not exist, - iso2mesh will use the relative path "iso2mesh/bin" to load those - binaries - 3. otherwise, it will give an error message, complaining the binary - can not be found. - - ISO2MESH_RANDSEED - sets the seed for the random number generators in the CGAL - modules - - Iso2mesh versions later than 1.0.0 can make reproducible meshes across - multiple runs. This was done by setting proper seeds for the random - number generators called inside the CGAL executables. By default, - iso2mesh will use 0x623F9A9E as the seed. If you prefer to set your own - seed, please define a global variable named ISO2MESH_RANDSEED in the - "base" workspace. The value of ISO2MESH_RANDSEED must be a positive - integer. If iso2mesh detects the definition of ISO2MESH_RANDSEED, it - will use it to seed the RNGs. - -Intermediate outputs - - For each step of the mesh generation along the [3]work-flow, iso2mesh - will save some intermediate outputs as logs. These outputs are saved - under the output of mwpath('') (see the explanations for ISO2MESH_TEMP - above). - - pre_extract.inr - if one use the default 'cgalsurf' method in vol2surf to extract - an isosurface from a binary image, this file will save the raw - binary image for each level set (only the last levelset stays) - - post_extract.off - the output surface mesh from 'cgalsurf' method (vol2surf) - - pre_remesh.off - if one use the 'simplify' option of vol2surf, this file saves - the voxel-resolution surface mesh extracted using binsurface - subroutine - - post_remesh.off - this file records the triangular surface after mesh - simplifications (meshresample) - - pre_sclean.off - for 'simplify' approach, this file is the surface mesh before - the mesh validation (meshcheckrepair) - - post_sclean.off - this is the output from 'mechcheckrepair' subroutine. - - post_vmesh.poly - when generating the 3D tetrahedral mesh, tetgen needs an input - file with PLC (piece-wise linear complexes) which is saved in - this poly file. - - post_vmesh.off - if no bounding box needed, this file saves the same info as the - poly file, except it is in off format. - - post_vmesh.1.ele - tetgen output: tetrahedral element file - - post_vmesh.1.face - tetgen output: boundary surface element file - - post_vmesh.1.node - tetgen output: node file - -References - - 1. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=rss - 2. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Installation - 3. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Workflow diff --git a/ext_libs/iso2mesh/doc/Download_and_License.txt b/ext_libs/iso2mesh/doc/Download_and_License.txt deleted file mode 100755 index 25f77e3b5..000000000 --- a/ext_libs/iso2mesh/doc/Download_and_License.txt +++ /dev/null @@ -1,138 +0,0 @@ - #[1]iso2mesh: a Matlab/Octave-based mesh generator - -How to obtain iso2mesh - - 1. [2]Download the latest release - - 2. [3]Download Development Snapshot from SVN (not fully tested) - - 2.1. [4]Anonymous SVN Access - - 2.2. [5]Developer SVN Access - - 3. [6]Important Note on Licenses - -1. Download the latest release - -iso2mesh 2013 (1.5.0), codenamed [7]Laba Porridge - - Please download the latest v1.5.0 release at our - [8]registration/download page. We are greatly appreciated if you can - tell us a little bit about you and your related research by - [9]registering your copy of iso2mesh. - * Release date: July 16, 2013 - * This software is supported on [os-icons3.png] - -iso2mesh 1.4.9, codenamed Laba Porridge (beta) - - Please download the stable v1.4.9 release at our - [10]registration/download page. - * Release date: Jan. 20, 2013 - -2. Download Development Snapshot from SVN (not fully tested) - - If you want to get the latest development branch of iso2mesh, you have - to download it from our subversion (SVN) repository. You have to be - aware that an SVN snapshot is not a stable release. It may contain - partially implemented features and, thus, cause crash or erroneous - results. - - First, make sure you have installed an SVN client on your system. If - your system is a Debian-based GNU/Linux system (such as Ubuntu, Knoppix - etc), you can install SVN by - sudo apt-get install subversion - - if you are using a Redhat-based GNU/Linux system (such as Fedora, - CentOS etc), you can do this by - su -c 'yum install subversion' - - If your operating system is Windows, we recommend you installing - [11]TortoiseSVN. - -2.1. Anonymous SVN Access - - The latest code snapshot can be checked out from project's [12]SVN - repository. It can be checked out anonymously by the following command. - - svn checkout svn://svn.code.sf.net/p/iso2mesh/code/trunk/iso2mesh iso2mesh - - After checking out the code, you need to set up the path based on the - [13]installation instructions. Then you can start matlab or octave, and - run the example scripts under the sample directory. - -2.2. Developer SVN Access - - If you are one of the developers who have SVN write-permission, you can - checkout the latest code with the same command above. - - You will have to [14]register an account and ask the [15]project - maintainer to grant you SVN permission). - - Once checkout, you can simply make changes or debug your changes in - your local copy. If your local changes have passed review by other - co-developers, you can then commit your changes back to the SVN - repository by - - cd /path/to/iso2mesh/local/copy - svn commit -m "a short summary of your changes" - -3. Important Note on Licenses - - The iso2mesh toolbox is licensed under [16]GNU Public License (GPL). - However, it included a number of external tools (under bin/ directory) - to perform certain functionality by means of [17]pipelines. These - external tools are subjected to their upstream licenses and are not - necessarily GPL (or GPL compatible). The complete list of these - external commands and their author info and licenses can be found from - the [18]README page. - - Particularly, the 3D meshing tool, tetgen, is licensed under a non-free - license: it can be freely used, modified, redistributed only for - research and academic purposes, any commercial utility of tetgen - requires a permission from its [19]original author. iso2mesh calls - tetgen in the background to produce 3D mesh, that means if anyone needs - to uses the 3D mesh produced by iso2mesh in a commercial product, you - MUST contact the author of tetgen to get permission. Processing binary - images and produce surfaces are not subject to this limitation. - - In additional to the licenses, if you use this tool in your research, - we are greatly appreciated if you can add iso2mesh to your references: - - Qianqian Fang, iso2mesh: a matlab-based 3D tetrahedral mesh generator, URL: [20]http://iso2mesh.sourceforge.net, 2008 - - or - - Qianqian Fang and David Boas, "Tetrahedral mesh generation from volumetric binary and gray-scale images," - Proceedings of IEEE International Symposium on Biomedical Imaging 2009, pp. 1142-1145, 2009 - - If you used cgalsurf or cgalmesh options in your mesh preparation, you - should also acknowledge [21]CGAL publications. If you generated your - mesh with the tetgen module in iso2mesh instead of CGAL mesher, you may - need to [22]acknowledge tetgen in your publications, you can find more - references from [23]this link. - -References - - 1. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=rss - 2. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download#Download_the_latest_release - 3. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download#Download_Development_Snapshot_from_SVN_not_fully_tested - 4. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download#Anonymous_SVN_Access - 5. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download#Developer_SVN_Access - 6. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Download#Important_Note_on_Licenses - 7. http://en.wikipedia.org/wiki/Laba_Congee - 8. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?register/iso2mesh - 9. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=edit&id=register/iso2mesh - 10. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?register/iso2mesh - 11. http://tortoisesvn.net/downloads - 12. http://sourceforge.net/p/iso2mesh/code/404/tree/ - 13. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Installation - 14. https://sourceforge.net/user/registration - 15. http://sourceforge.net/users/fangq - 16. http://www.gnu.org/licenses/gpl-2.0.html - 17. http://en.wikipedia.org/wiki/Unix_pipe - 18. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/README#Acknowledgement - 19. http://www.wias-berlin.de/~si - 20. http://iso2mesh.sourceforge.net/ - 21. http://www.cgal.org/bibliography.html - 22. http://tetgen.berlios.de/reference.html - 23. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/References diff --git a/ext_libs/iso2mesh/doc/FAQ.txt b/ext_libs/iso2mesh/doc/FAQ.txt deleted file mode 100755 index a78171a16..000000000 --- a/ext_libs/iso2mesh/doc/FAQ.txt +++ /dev/null @@ -1,273 +0,0 @@ - #[1]iso2mesh: a Matlab/Octave-based mesh generator - -Frequently asked questions about iso2mesh - - 1. [2]I am getting a "Two subfaces ... are found intersecting - each other" error, what should I do? - - 2. [3]After mesh generation, the surface plot looks messed up, - what was wrong? - - 3. [4]Matlab complains about imread, imclose or imfill missing - - 4. [5]iso2mesh failed when writing files to disk - - 5. [6]When displaying a surface produced by iso2mesh, there are - many holes, how to fix this? - - 6. [7]Subroutine meshresample returns an empty mesh, why? - - 7. [8]Which meshing option should I choose? - - 8. [9]How do I control mesh density in iso2mesh? - - 9. [10]How to mesh a domain containing multiple isolated objects - ? - -1. I am getting a "Two subfaces ... are found intersecting each other" error, what should I do? - - This is the most frequently encountered problem using this toolbox. - There are three possible causes of this error: - -1. the volume you are trying to mesh contains joint regions between more than 2 materials - - This is most likely happening when you see the above error message. Try - to plot your volume slice by slice, and pay attention to any voxels - whose neighbors have more than 2 different values. If this is the case, - you can only use this type of input with vol2mesh/v2m with 'cgalmesh' - option as the "method" parameter. If you use either "simplify" or - "cgalsurf" (default) options, iso2mesh will fail. If for some reason - you have to use these options, here are two possible temporary - work-arounds: - 1. if there are not many junction voxels, you may want to manually - edit your image and disconnect the regions that share the same - boundary and make sure all the sub-regions are either completely - disjointed, or completely enclosed by another. - 2. merge the regions that have shared boundaries, and mesh the - resulting merged volume; after you get the tetrahedra, compute the - centroid of each element in the merged domain (identified by their - labels), and map them back to your original segmented image; - determine the original region id using the voxel containing the - centroids. - - If you have any better suggestions to enable iso2mesh to handle this - situation, please let [11]me know. - -2. you are using 'simplify' method to mesh a complex domain - - There are two possible methods for volume-to-surface conversion, - 'simplify' and 'cgalsurf'. The second method always returns a - well-posed surface where no self-intersecting elements present; - however, the 'simplify' approach does not. The default method for - vol2mesh/vol2surf (v2m/v2s) is 'cgalsurf'. If you have to use - 'simplify', you may have to experiment different surface densities for - the surface extraction. You may lucky enough to find a working - configuration, but very likely, you may not. Please use 'cgalsurf' - option whenever possible. - -3. your surface mesh is too coarse and intersects the enclosed surfaces - - The mesh extraction will represent the region boundaries by a sheet of - triangles. Near sharp edges, this representation may generate a rounded - edge and does not exactly preserve the shape of the original domain. If - you happen to mesh a thin layer of material, the resulting surface may - intersect each other at sharp edges if your surface element is too big. - Please use a small opt.radbound value to run the mesh generation again. - -2. After mesh generation, the surface plot looks messed up, what was wrong? - - It is very likely you incorrectly used the output variables. The output - of vol2mesh or surf2mesh include elem: the tetrahedral element indices, - and face: the surface triangle indices. But be careful, both of these - two arrays have an additional column. The last column is a label field, - indicating the origin (sub-region) of the elements. You should never - use the last columns of these two arrays for plotting. To make a - correct surface plot, you should use something like - trisurf(face(:,1:3),node(:,1),node(:,2),node(:,3)); - - and don't use the full face array as the first parameter. - - If you are using iso2mesh newer than 0.9.8, you can use a function - called "plotmesh" to visualize the produced surfaces and volumes. The - script will attempt to recognize the extra column of "face" by using - the Euler characteristics and automatically ignore it if present. - -3. Matlab complains about imread, imclose or imfill missing - - Under the sample/ directory, demo_vol2mesh_ex2.m requires imread, which - is a build-in function in matlab, but not in octave. You have to - install octave-image via apt-get or yum first. In example - demo_vol2mesh_ex3.m, functions imclose and imfill are needed. These two - functions can only be found in matlab's image processing toolbox. If - you don't have this toolbox installed (of course, it is not free), you - can simply pass this example. For octave, unfortunately, these - functions do not exist yet, and hopefully someone can fill them in - soon. - -4. iso2mesh failed when writing files to disk - - If you are working on a multi-user workstation, and multiple users were - using iso2mesh, some temporary files may have a conflict in read/write - permission under /tmp directory. If user A runs iso2mesh first, and - user B will get this error, because iso2mesh fails to create the - temporary files as it does not have the permissions to overwrite those - files created by A. To solve this issue, please define your own - temporary folder, or set your session id, you can find more info at - [12]Advanced page. - -5. When displaying a surface produced by iso2mesh, there are many holes, how to fix this? - - The node orders in the output surface mesh are random, some are - oriented clockwise, some are counter-clockwise. This will make OpenGL, - or OpenGL based applications, render the surface with different - materials. To correct this, you can simply call - [newnode,newface]=meshcheckrepair(node,face); - - and the new surface: [newnode,newface] will have consistent - orientations. Again, be careful if you are using the face output from - vol2surf/v2s, it has an extra column. You only need to use the first 3 - columns in the face array when making plots. - -6. Subroutine meshresample returns an empty mesh, why? - - When the input surface mesh contains topological defects, such as - non-manifold nodes, the meshresample() subroutine will not proceed and - return an empty mesh (the output message will show "0 total edges - collapsed"). In this case, you need to first call meshcheckrepair() - subroutine to fix your input mesh, and them pass it to meshresample. An - example is shown below: - [no2,fc2]=meshcheckrepair(node_in,face_in); - [node_out,face_out]=meshresample(no2,fc2,0.2); - - (this issue is automatically corrected in iso2mesh 0.8 or newer) - -7. Which meshing option should I choose? - - Iso2mesh provides 3 options for v2m and vol2mesh, namely, 'cgalmesh', - 'cgalsurf' and 'simplify'. Some users may get confused which one to - use. In fact, we were hoping not to put users in this situation, as - iso2mesh was designed for simplicity and efficiency. Unfortunately, we - haven't really found a single option that works for all of the - situations, and each of the 3 options have there good and bad sides. - - * cgalmesh: this is the most powerful option of all, and is - potentially the ideal candidate as the default option. With - 'cgalmesh', iso2mesh can easily process a binary volume and a - volume with multi-region labels with good speed and robustness. It - can produce both volumetric and surfaces meshes at the same time, - and clearly labels the element and surfaces for each individual - sub-region. However, it is not perfect. It can not extract - iso-surfaces from a gray-scale image. When you want to control mesh - densities near a specific isosurface (such as [13]this case), - cgalmesh option is not as flexible as the other two. In short, - cgalmesh is the best choice for producing uniform-sized meshes from - an arbitrary segmented volume. - * cgalsurf: cgalsurf option produces surface and volumetric meshes - with a standard 2-step process as shown in the [14]workflow. When - extracting multiple isosurfaces, it will do the extraction - sequentially. The strengths of cgalsurf include 1) all the - extracted surfaces are guaranteed to be free of self-intersecting - elements, individually, and 2) it can handle gray-scale volumes. - The main issue for cgalsurf is when multiple isosurfaces overlap to - each other, v2m/vol2mesh will break as the combined surface - contains self-intersecting elements. In short, cgalsurf is the best - option when multiple sub-regions are disconnected, or one enclosing - another. - * simplify: this is as flexible as cgalsurf, but it is not as - reliable. After the mesh simplification, a surface may become - self-intersecting and v2m/vol2mesh will stop working. However, when - you only have a dense surface to start with, this is the only - option you can use. - - To make it easy to remember: - 1. when meshing a simple binary volume, 'cgalmesh' and 'cgalsurf' are - both good choices - 2. when meshing a segmented volumes with multiple sub-regions, use - 'cgalmesh' - 3. when meshing a gray-scale volume, use 'cgalsurf' - 4. when other options fail, try 'simplify'. - -8. How do I control mesh density in iso2mesh? - - Iso2mesh uses two parameters to quantitatively control the mesh - density. In v2m or vol2mesh, parameter opt sets the maximum edge length - of the surface triangles (i.e. controlling the density of the mesh on - the surface), and maxvol sets the maximum tetrahedron volume. - - If you want to let the mesh be denser on the surface and coarser - inside, you can use a small opt value and a large maxvol value. - - If you want to control the surface mesh density so that it adapts - depending on the curvature, you can do so by defining opt as a struct, - and set the opt.radbound and opt.distbound values. You can find - examples from [15]this presentation (slide 15). This example can also - be accessed from iso2mesh/sample/demo_helloworld.m - -9. How to mesh a domain containing multiple isolated objects ? - - This is a known issue with the CGAL [16]surface mesher and [17]3D - mesher. A bug report has been filed [18]here, but it was not known if - any fix has been applied upstream. - - For v2m/v2s with a 'cgalmesh' option, a simple work-around is to remove - zero-voxels by adding 1 to the 3D image. Then cgalmesher should be able - to recover all inclusions, along with the background. You can then - remove the background by checking the domain ID. For example: - - [no,el]=v2m(uint8(img+1), [], opt, maxvol, 'cgalmesh'); - el=el(find(el(:,5)>1),:); - [no,newel]=removeisolatednode(no(:,1:3),el(:,1:4)); - newel(:,5)=el(:,5)-1; - - If the target domain is a binary image, there is another work-around: -function [node,elem]=meshisolatedobj(img,opt,maxvol) -% -% Usage: -% [node,elem]=meshisolatedobj(img,opt,maxvol) -% Author: Qianqian Fang -% -img=logical(img); -[bin,regionnum]=bwlabeln(img,6); -node=[]; -elem=[]; - -for regionid=1:regionnum - fprintf(1,'meshing region #%d ...\n',regionid); - - [no,el]=v2m(bin==regionid,0.5,opt,maxvol); - - % merge the resulting mesh with other regions - el(:,5)=regionid; - el(:,1:4)=el(:,1:4)+size(node,1); - if(regionid>1) - elem=[elem;el]; - node=[node;no]; - else - node=no; - elem=el; - end -end - - This function only works in Matlab because function bwlabeln is not - available in Octave. - -References - - 1. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=rss - 2. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#I_am_getting_a_Two_subfaces_are_found_intersecting_each_other_error_what_should_I_do - 3. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#After_mesh_generation_the_surface_plot_looks_messed_up_what_was_wrong - 4. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#Matlab_complains_about_imread_imclose_or_imfill_missing - 5. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#iso2mesh_failed_when_writing_files_to_disk - 6. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#When_displaying_a_surface_produced_by_iso2mesh_there_are_many_holes_how_to_fix_this - 7. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#Subroutine_meshresample_returns_an_empty_mesh_why - 8. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#Which_meshing_option_should_I_choose - 9. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#How_do_I_control_mesh_density_in_iso2mesh - 10. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FAQ#How_to_mesh_a_domain_containing_multiple_isolated_objects - 11. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?FangQ - 12. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Advanced - 13. http://iso2mesh.sourceforge.net/upload/head_mesh.jpg - 14. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Workflow - 15. http://iso2mesh.sf.net/upload/iso2mesh_a_one_liner_mesh_generator.pdf - 16. http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Surface_mesher/Chapter_main.html - 17. http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Mesh_3/Chapter_main.html - 18. http://cgal-discuss.949826.n4.nabble.com/missing-objects-when-meshing-a-3D-image-with-multiple-disconnected-inclusions-td3349283.html diff --git a/ext_libs/iso2mesh/doc/Get_Started.txt b/ext_libs/iso2mesh/doc/Get_Started.txt deleted file mode 100755 index 6d7b152c7..000000000 --- a/ext_libs/iso2mesh/doc/Get_Started.txt +++ /dev/null @@ -1,55 +0,0 @@ - #[1]iso2mesh: a Matlab/Octave-based mesh generator - -Getting Started with iso2mesh - - Although iso2mesh provides a rich collection of [2]mesh-related - functions, the core functionality, i.e. creating volumetric meshes from - surfaces or binary image stacks, is very straightforward to use. A - minimum step to perform such task only requires about 3 to 5 lines of - matlab code. You can find a list of examples under the "sample" - directory. In [3]this page, we summarize the overall work-flow of this - toolbox. - - To outline a simple meshing session, let's assume you have a 3D image - array, named "mydata", saved in a file called "mydata.mat". Variable - mydata can be any 3D image, an MRI/CT scan or a simple binary mask - produced by your own command. Here are the commands you need to produce - a volumetric FEM mesh from this volume: - - load mydata.mat - [node,elem,face]=v2m(mydata,0.5,5,100); - plotmesh(node,face) - - Apparently, the first line loads the volumetric image data into your - current session. The second line calls an iso2mesh function, 'v2m', the - shortcut for vol2mesh, to construct a volumetric mesh from this data - array. The first argument of v2m, "mydata", is the volumetric image you - are about to mesh; the 2nd argument is the threshold value at which you - define the boundary surface of the mesh; the 3rd argument, 5, defines - the maximum size of the surface triangles; the last argument, 100, - defines the maximum volume of the resulting tetrahedral elements. You - can define a vector for the second argument, asking iso2mesh to produce - multiple level-sets as the exterior or internal interfaces of the - target domain. Both the 3rd and 4th arguments controls the density of - the resulting mesh: the smaller the values, the more triangles on the - surface and more tetrahedra in the volumetric mesh. - - There are 3 outputs from v2m command: - * node: the node coordinates for the generated volumetric mesh, with - dimension of NN x 3, with each column being x, y and z, - respectively; NN is the number of nodes. - * elem: the tetrahedral element info, with a dimension of NE x 4, NE - being the number of tetrahedral elements; each row represents an - element, and each column are the node indices for each corner of a - tetrahedron. - * face: triangular surface element info, with a dimension of NS x 4, - NS being the number of surface triangles;the first 3 columns are - the node indices of each corner of the triangle, and the last - column is a flag to identify its mapping to the original surface - id. - -References - - 1. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=rss - 2. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/FunctionList - 3. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/Workflow diff --git a/ext_libs/iso2mesh/doc/INSTALL.txt b/ext_libs/iso2mesh/doc/INSTALL.txt deleted file mode 100755 index ca09895c7..000000000 --- a/ext_libs/iso2mesh/doc/INSTALL.txt +++ /dev/null @@ -1,76 +0,0 @@ - #[1]iso2mesh: a Matlab/Octave-based mesh generator - -Installation Instructions for iso2mesh toolbox - -System Requirements - - Iso2mesh is written in the Matlab language and is fully compatible with - [2]GNU Octave, as a result, any system that is capable of running - Matlab or Octave is able to run this toolbox in theory. However, as we - described in the [3]Doc/README, this toolbox relies on multiple - external tools/libraries for full functionality. So far, we have only - compiled these external tools for Linux (32/64bit), Mac OS (Intel based - or PowerPC based) and Windows (95~Windows 7, 32/64bit). If your - platform is not listed above (such as Solaris, AIX etc), please - download the [4]source code of these tools and compile them on your own - machine. - - The recommended system configuration for running this toolbox includes - * a computer running GNU/Linux, Windows, Mac OS (either 32bit/64bit) - * standard installation of Matlab (v7 or above) or Octave (3.0 or - above) (for some demos, you need to install the image processing - toolbox for Matlab/Octave) - * 30M disk space for the toolbox and the examples - * a folder where you have write permission - -Installation - - The installation of iso2mesh to your system is straightforward, - simplify following the instructions below: - * extract the downloaded package to a folder, for example, - /home/myaccount/work/iso2mesh, let's call it the "root directory" - of iso2mesh; - * start your Maltab, type addpath('/home/myaccount/work/iso2mesh') to - add iso2mesh to your Matlab search path for the current session - + if you want to add this path permanently for Matlab, you need - to type pathtool, browse to the iso2mesh root directory and - add it to the list, then click "Save" - * then, you can do a rehash in Matlab, and type which vol2mesh, if - you see an output, that means iso2mesh is now installed in Matlab - * you can navigate to a folder named "sample" inside iso2mesh's root - directory, and run the demo scripts, you should be able to see the - code complete with no error message. If it complains that some - commands can not be found, please make sure you have followed the - instructions above. - -For restricted users - - You do not have to be a system administrator to install or use iso2mesh - toolbox. Most of the installation instructions can be done on a - per-user basis. The only issue a restricted user may encounter is the - "permission error" when saving the "pathtool" path list in order to add - iso2mesh permanently. If this happens, you may work in a multi-user or - network-based system. For Matlab users, you typically need to create - file named [5]startup.m under the [6]Matlab startup directory - (~/matlab/ for Linux/Unix), and put addpath('/path/to/iso2mesh/'); into - this file. It will be automatically executed when Matlab starts. For - Octave, this file is [7].octaverc. - - When using this toolbox under an extensively restricted mode, one may - encounter a "fail to write" error, this may likely be caused by the - default output folder is not writable from your account. If you do have - another folder which you have permission to write, you need to - [8]define an variable ISO2MESH_TEMP in Matlab/Octave's "base workspace" - and set the value as the writable folder path, then rerun your meshing - commands. - -References - - 1. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?action=rss - 2. http://www.gnu.org/software/octave/ - 3. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Doc/README - 4. http://sourceforge.net/p/iso2mesh/code/402/tree/trunk/ - 5. http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f8-4994.html#brlkmbe-1 - 6. http://www.mathworks.com/help/techdoc/matlab_env/f8-10506.html - 7. http://en.wikibooks.org/wiki/MATLAB_Programming/Differences_between_Octave_and_MATLAB#startup.m - 8. http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?Advanced diff --git a/ext_libs/iso2mesh/doc/gendoc.sh b/ext_libs/iso2mesh/doc/gendoc.sh deleted file mode 100755 index e4b5d9790..000000000 --- a/ext_libs/iso2mesh/doc/gendoc.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# commands to update the document pages from homepage - -lynx -dont_wrap_pre -dump "http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?keywords=Download&embed=1" > Download_and_License.txt -lynx -dont_wrap_pre -dump "http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?keywords=Doc/Installation&embed=1" > INSTALL.txt -lynx -dont_wrap_pre -dump "http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?keywords=Doc/Basics&embed=1" > Get_Started.txt -lynx -dont_wrap_pre -dump "http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?keywords=Doc/FAQ&embed=1" > FAQ.txt -lynx -dont_wrap_pre -dump "http://iso2mesh.sourceforge.net/cgi-bin/index.cgi?keywords=Advanced&embed=1" > Advanced_Features.txt - -wget http://iso2mesh.sourceforge.net/upload/iso2mesh_workflow_v2.png -Oiso2mesh_workflow.png diff --git a/ext_libs/iso2mesh/doc/iso2mesh_workflow.jpg b/ext_libs/iso2mesh/doc/iso2mesh_workflow.jpg deleted file mode 100755 index 5e3b3d494..000000000 Binary files a/ext_libs/iso2mesh/doc/iso2mesh_workflow.jpg and /dev/null differ diff --git a/ext_libs/iso2mesh/sample/brain.tif b/ext_libs/iso2mesh/sample/brain.tif deleted file mode 100755 index de8d88bf3..000000000 Binary files a/ext_libs/iso2mesh/sample/brain.tif and /dev/null differ diff --git a/ext_libs/iso2mesh/sample/brain_seg.tif b/ext_libs/iso2mesh/sample/brain_seg.tif deleted file mode 100755 index ffdd6aac9..000000000 Binary files a/ext_libs/iso2mesh/sample/brain_seg.tif and /dev/null differ diff --git a/ext_libs/iso2mesh/sample/demo_cgalmesher.m b/ext_libs/iso2mesh/sample/demo_cgalmesher.m deleted file mode 100755 index b4152b976..000000000 --- a/ext_libs/iso2mesh/sample/demo_cgalmesher.m +++ /dev/null @@ -1,52 +0,0 @@ -% This example calls cgalmesher to mesh a segmented -% brain volume. The segmentation was done by FreeSurfer -% and there are 41 different types of tissues. Each tissue -% type is labeled by a unique integer. - -fprintf(1,'loading segmented brain image...\n'); -for i=1:256 - brain(:,:,i)=imread('brain_seg.tif',i); -end -brain=uint8(brain); - -% call cgalmesher to mesh the segmented volume -% this will take 30 seconds on an Intel P4 2.4GHz PC - -fprintf(1,'meshing the segmented brain (this may take a few minutes) ...\n'); - -[node,elem,face]=v2m(brain,[],2,100,'cgalmesh'); - -figure -hs=plotmesh(node,face,'y>100'); - -axis equal; -title('cross-cut view of the generated surface mesh'); - -% find the sub-region number 3, it happens to be the right-hemisphere -% cerebellum white matter. Use volface to extract the white matter surface. - -fprintf(1,'extracting the right-hemisphere cerebellum white matter surface\n') - -LHwhitemat=elem(find(elem(:,5)==5),:); -wmsurf=volface(LHwhitemat(:,1:4)); - -figure; -hs=plotmesh(node,wmsurf); -axis equal; -title('pre-smoothed cerebellum white matter surface'); - - -fprintf(1,'performing mesh smoothing on the white matter surface\n') - -[no,el]=removeisolatednode(node,wmsurf); -wmno=sms(no(:,1:3),el,3,0.5); - -figure; -hs=plotmesh(wmno,el); -axis equal; -title('smoothed cerebellum white matter surface of the right-hemisphere'); - - -fprintf(1,'generate volumetric mesh from the smoothed cerebellum white matter surface \n') - -[wmnode,wmelem,wmface]=s2m(wmno(:,1:3),el(:,1:3),1,200); diff --git a/ext_libs/iso2mesh/sample/demo_directplc_ex1.m b/ext_libs/iso2mesh/sample/demo_directplc_ex1.m deleted file mode 100755 index 8a48bb293..000000000 --- a/ext_libs/iso2mesh/sample/demo_directplc_ex1.m +++ /dev/null @@ -1,51 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% angular resolution -dt=pi/40; -t=0:dt:2*pi-dt; - -%% parameters of a side-cut fiber -h=100; -r1=20; -r2=25; -a=-1; -b=0; -c=1; -d=-h; - -%% key nodes of a side-cut fiber - -n1=[r1*sin(t(:)) r1*cos(t(:)) zeros(size(t(:)))]; -n2=[r2*sin(t(:)) r2*cos(t(:)) zeros(size(t(:)))]; - -n3=[r1*sin(t(:)) r1*cos(t(:)) -d-(a*r1*sin(t(:))+b*r1*cos(t(:)))/c]; -n4=[r2*sin(t(:)) r2*cos(t(:)) -d-(a*r2*sin(t(:))+b*r2*cos(t(:)))/c]; - -no=[n1;n2;n3;n4]; - -%% PLCs of the side-cut fiber - -clear fc; -count=1; -for i=1:length(t)-1 - % the last number in each cell is the fc id - fc{count}={[i+length(t) i+3*length(t) i+3*length(t)+1 i+length(t)+1],1}; count=count+1; - fc{count}={[i i+2*length(t) i+2*length(t)+1 i+1],2}; count=count+1; -end -i=length(t); -fc{count}={[i+length(t) i+3*length(t) 1+3*length(t) 1+length(t)],1}; count=count+1; -fc{count}={[i i+2*length(t) 1+2*length(t) 1],2}; count=count+1; - -fc{count}={1:1+length(t)-1,3};count=count+1; % bottom inner circle -fc{count}={[1+length(t):1+length(t)*2-1 nan fliplr(1:1+length(t)-1)],4};count=count+1; % button outter circle -fc{count}={1+length(t)*2:1+length(t)*3-1,5};count=count+1; % top inner circle -fc{count}={[1+length(t)*3:1+length(t)*4-1 nan fliplr(1+length(t)*2:1+length(t)*3-1)],6}; % top outter circle - -%% mesh generation of the cladding for the side-cut fiber -%[node,elem,face]=s2m(no,face,1,50); -[node,elem,face]=surf2mesh(no,fc,min(no),max(no),1,50,[0 0 1],[],0); - -plotmesh(no,fc,'y>-0.1'); -figure -plotmesh(node,elem,'x>0 | y>0'); diff --git a/ext_libs/iso2mesh/sample/demo_grayscale_ex1.m b/ext_libs/iso2mesh/sample/demo_grayscale_ex1.m deleted file mode 100755 index bbf667dc4..000000000 --- a/ext_libs/iso2mesh/sample/demo_grayscale_ex1.m +++ /dev/null @@ -1,28 +0,0 @@ -% this example demonstrates how to mesh a gray-scale volume directly. -% the data set is a Jacobian matrix obtained by multiplying two -% Green's functions -% see Appendix in Qianqian Fang, Computational methods for microwave medical imaging. Ph.D. -% Dissertation, Dartmouth College, Hanover, NH, U.S.A., Dec 2004. - -[xi,yi,zi]=meshgrid(1:40,1:40,1:80); -r1=[xi(:)-20,yi(:)-20,zi(:)-20]; -r2=[xi(:)-20,yi(:)-20,zi(:)-60]; -r1=reshape(r1(:,1).^2+r1(:,2).^2+r1(:,3).^2,size(xi)); -r2=reshape(r2(:,1).^2+r2(:,2).^2+r2(:,3).^2,size(xi)); - -k=10; - -% generate Green's functions - -g1=exp(sqrt(-1)*k*r1)./(4*pi*r1); -g2=exp(sqrt(-1)*k*r2)./(4*pi*r2); - - -%get Jacobian (sensitivity) -g12=g1.*g2; - -% create a mesh based on the level-set at log(J)=-7.5 - -[node,elem,face]=v2m(log10(abs(g12))+10,2.5,2,10,'cgalsurf'); - -plotmesh(node,face); diff --git a/ext_libs/iso2mesh/sample/demo_helloworld.m b/ext_libs/iso2mesh/sample/demo_helloworld.m deleted file mode 100755 index a5b1bdcc9..000000000 --- a/ext_libs/iso2mesh/sample/demo_helloworld.m +++ /dev/null @@ -1,59 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Hello World - The "getting started" example of iso2mesh -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% In this example, we illustrate the basic mesh density and precision -% controls in iso2mesh. - -%% the first step is to load a binary or gray-scale image - -hw=imread('helloworld.png'); - -% now we stack the image and form a binary volume - -hw3d=1-repmat(hw,[1 1 50]); - -%% create 3D mesh |--------> threshold at v=0.7 -[node,elem,face]=v2m(hw3d,0.7,5,40); -% | |-> maximum volume -% |----> maximum surface triangle size - -figure; -subplot(211); -plotmesh(node,face);axis equal;view(90,60); -subplot(212); -plotmesh(node,elem,'z<20');axis equal;view(90,60); - -% mesh with denser surface |----> surface triangle size is now 2 -[node,elem,face]=v2m(hw3d,0.7,2,40); - -figure; -subplot(211); -plotmesh(node,face);axis equal;view(90,60); -subplot(212); -plotmesh(node,elem,'z<20');axis equal;view(90,60); - -%% create 3D mesh from gray-scale image to get smoother boundary -hw=imread('helloworld_gray.png'); -hw3d=255-repmat(hw,[1 1 50]); -[node,elem,face]=v2m(hw3d,128,2,40); - -figure; -subplot(211); -plotmesh(node,face);axis equal;view(90,60); -subplot(212); -plotmesh(node,elem,'z<20');axis equal;view(90,60); - -%% create 3D mesh from gray-scale image with advanced distbound control -clear opt -opt.radbound=4; % set surface triangle maximum size -opt.distbound=0.2; % set max distance that deviates from the level-set -opt.autoregion=1; -[node,elem,face]=v2m(hw3d,128,opt,40); - -figure; -subplot(211); -plotmesh(node,face);axis equal;view(90,60); -subplot(212); -plotmesh(node,elem,'z<20');axis equal;view(90,60); - diff --git a/ext_libs/iso2mesh/sample/demo_insert_nodes.m b/ext_libs/iso2mesh/sample/demo_insert_nodes.m deleted file mode 100755 index bdcc8e0c1..000000000 --- a/ext_libs/iso2mesh/sample/demo_insert_nodes.m +++ /dev/null @@ -1,35 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script to insert new nodes to a tetrahedral mesh -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -load rat_head.mat - -[node,elem,face]=vol2mesh(volimage>0.05,1:size(volimage,1),1:size(volimage,2),... - 1:size(volimage,3),2,2,1); - -plotmesh(node,face); - -dt=pi/10; -r=3; -x0=30; -y0=28; -theta=dt:dt:2*pi; -x=x0+r*cos(theta); -y=y0+r*sin(theta); - -p0=[x;y;ones(1,length(theta))*50]'; -v0=[0,0,-1]; - -[t,u,v,idx,xnode]=raysurf(p0,v0,node,face(:,1:3)); - -hold on -plotmesh(p0,'r+'); - -goodpt=find(~isnan(xnode(:,1)) & ~isnan(xnode(:,2)) & ~isnan(xnode(:,3))); -[newnode,newelem,newface]=meshrefine(node,elem,face,xnode(goodpt,:)); - -figure -plotmesh(newnode,newface); -hold on -plotmesh(p0,'r+'); -plotmesh(xnode,'r.') diff --git a/ext_libs/iso2mesh/sample/demo_label_sizing.m b/ext_libs/iso2mesh/sample/demo_label_sizing.m deleted file mode 100755 index 2bb1a2748..000000000 --- a/ext_libs/iso2mesh/sample/demo_label_sizing.m +++ /dev/null @@ -1,50 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% specify maximum cell sizes for different labels -% (this is only valid when using 'cgalmesh' with v2m or vol2mesh) -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% create a dummy image - -rad = 10:10:50; -maxRad = max(rad); -box = zeros(maxRad+1,maxRad+1,maxRad+1); -image = box; -box(1,1,1) = 1; -%DT = bwdist(box,'euclidean'); -[ix,iy,iz]=meshgrid(1:maxRad+1,1:maxRad+1,1:maxRad+1); -DT = sqrt((ix - 1).*(ix -1) + (iy - 1).*(iy -1) + (iz - 1).*(iz -1)); - -for i = 1:size(rad,2) - ball = DT<=rad(i); - image(ball~=0) = image(ball~=0) + ball(ball~=0); -end - -image = uint8(image); - -% mesh the domain with different sizing options - -figure; -maxvol='1'; -[no,el]=v2m(image,[],5,maxvol,'cgalmesh'); -subplot(221); -plotmesh(no(:,1:3),el,'x-y<0'); -title('a single scalar sets cell size for all labels'); - -maxvol='1=2:2=1:3=2:4=1'; -[no,el]=v2m(image,[],5,maxvol,'cgalmesh'); -subplot(222); -plotmesh(no(:,1:3),el,'x-y<0'); -title(sprintf('maxvol is "%s"',maxvol)); - -maxvol='2:1:2:1'; -[no,el]=v2m(image,[],5,maxvol,'cgalmesh'); -subplot(224); -plotmesh(no(:,1:3),el,'x-y<0'); -title(sprintf('maxvol is "%s", same as above',maxvol)); - -maxvol='3=2:1:0.5'; -[no,el]=v2m(image,[],5,maxvol,'cgalmesh'); -subplot(223); -plotmesh(no(:,1:3),el,'x-y<0'); -title(sprintf('maxvol is "%s", same to 3=2:4=1:5=0.5',maxvol)); - diff --git a/ext_libs/iso2mesh/sample/demo_merge_surfaces.m b/ext_libs/iso2mesh/sample/demo_merge_surfaces.m deleted file mode 100755 index 4745dc9fa..000000000 --- a/ext_libs/iso2mesh/sample/demo_merge_surfaces.m +++ /dev/null @@ -1,37 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Merge multiple surfaces and remove self-intersection elements -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% generate a mesh for -load rat_head.mat -[node0,face0]=v2s(volimage,0.5,2); - -c0=mean(meshcentroid(node0,face0(:,1:3))); -c1=2*[18.5 20.7 20.9]-c0; - -[cnode,cface]=meshacylinder(c0,c1,4); -[cnode,cface]=meshcheckrepair(cnode,cface(:,1:3)); - -% combine two surfaces, producing 4 pieces of subsurfaces: surf 1 -% outside/inside of surf2 and surf2 outside/inside of surf1 - -[no,el]=surfboolean(node0,face0(:,1:3),'all',cnode,cface); -figure -plotmesh(no,el,'y>20') - -% take the first surface only - -% el(:,4)==1: surf 1 outside of surf 2; el(:,4)==3: surf 1 inside of surf 2 -[no,el]=surfboolean(node0,face0(:,1:3),'first',cnode,cface); -figure -plotmesh(no,el) - -% the mesh after boolean operation can have self-intersecting elements, one -% has to fix those defects before passing to s2m - -[no1,el1]=meshcheckrepair(no(:,1:3),el(:,1:3)); - -%ISO2MESH_TETGENOPT=' -A -q 0.8 -a 10 '; -[node,elem,face]=s2m(no1,el1,1,10); -figure; -plotmesh(node,face) diff --git a/ext_libs/iso2mesh/sample/demo_mesh_smoothing.m b/ext_libs/iso2mesh/sample/demo_mesh_smoothing.m deleted file mode 100755 index 9c2a7a479..000000000 --- a/ext_libs/iso2mesh/sample/demo_mesh_smoothing.m +++ /dev/null @@ -1,110 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for surface smoothing -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -% A,b are registration matrix and vector, respectively -%% perform mesh generation - -[node,face]=v2s(volimage,0.5,2,'cgalmesh'); - -face=face(:,1:3); - -p0=min(node); -p1=max(node); - -rownum=3; -colnum=4; -figure; -subplot(rownum,colnum,1); - -plotmesh(node,face(:,1:3)); -if(~isoctavemesh) - title({'Laplacian+HC Smoothing Test','no smoothing'}); -else - title('Laplacian+HC - no smoothing'); -end -axis equal; -set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) - -%========================================================= -% apply Laplacian+HC smoothing -%========================================================= - -n1=node; -for i=1:rownum*colnum-1 - n1=sms(n1,face(:,1:3),1,0.5); % apply Laplacian+HC mesh smoothing - subplot(rownum,colnum,i+1); - plotmesh(n1,face(:,1:3)); - title(['iter=' num2str(i)]); - axis equal; - set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) -end - -%========================================================= -% apply Laplacian smoothing -%========================================================= - -figure; -subplot(rownum,colnum,1); - -plotmesh(node,face(:,1:3)); -if(~isoctavemesh) - title({'Laplacian Smoothing Test','no smoothing'}); -else - title('Laplacian - no smoothing'); -end -axis equal; -set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) - -conn=meshconn(face(:,1:3),size(node,1)); - -n1=node; -for i=1:rownum*colnum-1 - n1=smoothsurf(n1,[],conn,1,0.5,'laplacian'); - subplot(rownum,colnum,i+1); - plotmesh(n1,face(:,1:3)); - title(['iter=' num2str(i)]); - axis equal; - set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) -end - - -%========================================================= -% apply Low-pass smoothing -%========================================================= - -figure; -subplot(rownum,colnum,1); - -plotmesh(node,face(:,1:3)); -if(~isoctavemesh) - title({'Low-pass Smoothing Test','no smoothing'}); -else - title('Low-pass - no smoothing'); -end -axis equal; -set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) - -conn=meshconn(face(:,1:3),size(node,1)); - -n1=node; -for i=1:rownum*colnum-1 - n1=smoothsurf(n1,[],conn,1,0.5,'lowpass'); - subplot(rownum,colnum,i+1); - plotmesh(n1,face(:,1:3)); - title(['iter=' num2str(i)]); - axis equal; - set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)]) -end - diff --git a/ext_libs/iso2mesh/sample/demo_qmeshcut_ex1.m b/ext_libs/iso2mesh/sample/demo_qmeshcut_ex1.m deleted file mode 100755 index 75390ce00..000000000 --- a/ext_libs/iso2mesh/sample/demo_qmeshcut_ex1.m +++ /dev/null @@ -1,79 +0,0 @@ -% qmeshcut demonstration -% -% by Qianqian Fang, -% -% to demonstrate how to use qmeshcut to produce cross-sectional plot -% of an un-structured (tetrahedral) mesh - -% run vol2mesh demo 1 to create a 3d mesh - -demo_vol2mesh_ex1 - -% define a plane by 3 points, in this case, z=mean(node(:,3)) - -z0=mean(node(:,3)); - -plane=[min(node(:,1)) min(node(:,2)) z0 - min(node(:,1)) max(node(:,2)) z0 - max(node(:,1)) min(node(:,2)) z0]; - -% run qmeshcut to get the cross-section information at z=mean(node(:,1)) -% use the x-coordinates as the nodal values - -[cutpos,cutvalue,facedata]=qmeshcut(elem(:,1:4),node,node(:,1),plane); - -% plot your results - -figure; -hsurf=trimesh(face(:,1:3),node(:,1),node(:,2),node(:,3),'facecolor','none'); -hold on; -if(isoctavemesh) - hcut=patch('Faces',facedata,'Vertices',cutpos); -else - hcut=patch('Faces',facedata,'Vertices',cutpos,'FaceVertexCData',cutvalue,'facecolor','interp'); -end -%set(hcut, 'linestyle','none') -axis equal; - -% qmeshcut can also cut a surface - -[bcutpos,bcutvalue,bcutedges]=qmeshcut(face(:,1:3),node,node(:,1),plane); -[bcutpos,bcutedges]=removedupnodes(bcutpos,bcutedges); -bcutloop=extractloops(bcutedges); - -bcutloop(isnan(bcutloop))=[]; % there can be multiple loops, remove the separators - -% plot the plane-surface cuts - -plot3(bcutpos(bcutloop,1),bcutpos(bcutloop,2),bcutpos(bcutloop,3),'r','LineWidth',4); - -% essencially, this should be the same as you do a removedupnodes(cutpos,facedata) -% and then call extractloop(facedata) - - -% qmeshcut can also cut along an isosurface - -% define a field over the mesh: sensitivity map from a source/detector pair - -r1=[node(:,1)-20,node(:,2)-25,node(:,3)-25]; -r2=[node(:,1)-10,node(:,2)-25,node(:,3)-14]; -r1=sqrt(r1(:,1).^2+r1(:,2).^2+r1(:,3).^2); -r2=sqrt(r2(:,1).^2+r2(:,2).^2+r2(:,3).^2); - -k=10; -g1=exp(sqrt(-1)*k*r1)./(4*pi*r1); % calculate the Green's function -g2=exp(sqrt(-1)*k*r2)./(4*pi*r2); -g12=g1.*g2; % this is the sensitivity map - -figure -plotmesh([node log10(abs(g12))],elem,'facealpha',0.5,'linestyle','none'); % plot the mesh - -hold on; -% cut the mesh at value=-4 -[cutpos,cutvalue,facedata]=qmeshcut(elem(:,1:4),node(:,1:3),log10(abs(g12)),-4); -patch('Vertices',cutpos,'Faces',facedata,'FaceVertexCData',cutvalue,'FaceColor','interp'); - -% cut the mesh at value=-4.5 -[cutpos,cutvalue,facedata]=qmeshcut(elem(:,1:4),node(:,1:3),log10(abs(g12)),-4.5); -patch('Vertices',cutpos,'Faces',facedata,'FaceVertexCData',cutvalue,'FaceColor','interp'); - diff --git a/ext_libs/iso2mesh/sample/demo_refine_spherebox_mesh.m b/ext_libs/iso2mesh/sample/demo_refine_spherebox_mesh.m deleted file mode 100755 index f7a2d817b..000000000 --- a/ext_libs/iso2mesh/sample/demo_refine_spherebox_mesh.m +++ /dev/null @@ -1,72 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Create meshes for a sphere inside a cubic domain -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% preparation - -% you have to add the path to iso2mesh toolbox -% addpath('/path/to/iso2mesh/toolbox/'); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Part 0. Create a Spherical Mesh -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -[no,el]=meshasphere([30 30 30],20,2.5); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Part I. A Coarse Mesh for a Sphere Inside a Box with Refinement -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% generate a coarse volumetric mesh from the sphere with an additional bounding box -% the maximum element volume is 8 - -ISO2MESH_SESSION='demo_sph3_'; - -srcpos=[30. 30. 0.]; % set the center of the ROI -fixednodes=[30.,30.,0.1; 30 30 30]; % add control points so we can refine mesh densities there -nodesize=[ones(size(no,1),1) ; 0.2; 4]; % set target edge size of 1 for all nodes on the sphere - % target edge size 0.3 near (30,30,0.05) - % and target edge size 4 near (30,30,30) -nfull=[no;fixednodes]; % append additional control points -[node3,elem3,face3]=surf2mesh([nfull,nodesize],el,[0 0 0],[61 61 61],1,8,[30 30 30],[],[2 2 2 2 6 6 6 6]); - % ^- add node size as the last ^ max volume ^- edge sizes at the 8 - % column to node corners of the bounding box -[node3,elem3,face3]=sortmesh(srcpos,node3,elem3,1:4,face3,1:3); % reorder the nodes/elements - % so that the nodes near earch order - % are more clustered in the memory -elem3(:,1:4)=meshreorient(node3,elem3(:,1:4)); % reorient elements to ensure the volumns are positive - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Part II. A Dense Mesh for a Sphere Inside a Box with Refinement -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% generate a dense volumetric mesh from the sphere with an additional bounding box -% the maximum element volume is 2 - -ISO2MESH_SESSION='demo_sph2_'; - -nodesize=[0.7*ones(size(no,1),1) ; 0.2; 2]; % set target edge size to 0.7 near the sphere - % 0.2 near (30,30,0.5) and 2 near (30,30,30) -[node2,elem2,face2]=surf2mesh([nfull,nodesize],el,[0 0 0],[61 61 61],1,2,[30 30 30],[],[1 1 1 1 5 5 5 5]); - -figure; plotmesh(node2,face2(:,1:3),'y>30');axis equal; - -[node2,elem2,face2]=sortmesh(srcpos,node2,elem2,1:4,face2,1:3); -elem2(:,1:4)=meshreorient(node2,elem2(:,1:4)); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Part III. A Coarse Mesh for a Sphere Inside a Box without Refinement -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -ISO2MESH_SESSION='demo_sph1_'; - -% reduce the surface node numbers to 20% -[no2,el2]=meshresample(no,el,0.2); % down sample the sphere mesh - -% using the coarse spherical surface, we generate a coarse volumetric -% mesh with maximum volume of 10 - -[node1,elem1,face1]=surf2mesh(no2,el2,[0 0 0],[61 61 61],1,10,[30 30 30],[],1); -[node1,elem1,face1]=sortmesh(srcpos,node1,elem1,1:4,face1,1:3); -elem1(:,1:4)=meshreorient(node1,elem1(:,1:4)); - -clear ISO2MESH_SESSION diff --git a/ext_libs/iso2mesh/sample/demo_remesh_surface.m b/ext_libs/iso2mesh/sample/demo_remesh_surface.m deleted file mode 100755 index a0ba8a27a..000000000 --- a/ext_libs/iso2mesh/sample/demo_remesh_surface.m +++ /dev/null @@ -1,33 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for surface repairing using surf2vol and remeshsurf -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -% A,b are registration matrix and vector, respectively -%% perform mesh generation - -[node,face]=v2s(volimage,0.5,2,'cgalmesh'); - -node=node(:,1:3); -face=face(:,1:3); - -plotmesh(node,face); -axis equal - -[newno,newfc]=remeshsurf(node,face,1); - -newno=sms(newno,newfc(:,1:3),3,0.5); - -figure; -plotmesh(newno,newfc(:,1:3)); -axis equal diff --git a/ext_libs/iso2mesh/sample/demo_shortcut_ex1.m b/ext_libs/iso2mesh/sample/demo_shortcut_ex1.m deleted file mode 100755 index 3021b7800..000000000 --- a/ext_libs/iso2mesh/sample/demo_shortcut_ex1.m +++ /dev/null @@ -1,39 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for using short-hand version of the meshing wrappers -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -%% v2m is the short-hand version of vol2mesh - -% mesh volimage at threshold level 0.05, max surface element size 3, -% maximum tetrahedral element volume 2 - -[node,elem,face]=v2m(volimage,0.05,3,2); - -%% visualize the resulting mesh -subplot(211); -plotmesh(node,face); -axis equal; - -%% alternatively, one can call vol2surf and surf2mesh separately - -% v2s: shorthand version of vol2surf, s2m: shorthand version of surf2mesh - -[node,face,regions,holes]=v2s(volimage,0.05,3); -[node,elem,face]=s2m(node,face,1,2); - -%% visualize the resulting mesh -subplot(212) -plotmesh(node,face); -axis equal; - diff --git a/ext_libs/iso2mesh/sample/demo_surf2mesh_ex1.m b/ext_libs/iso2mesh/sample/demo_surf2mesh_ex1.m deleted file mode 100755 index ad09ae379..000000000 --- a/ext_libs/iso2mesh/sample/demo_surf2mesh_ex1.m +++ /dev/null @@ -1,21 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for mesh generation from surface patches and bounding box -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load tube_surface.mat - -% f and v stores the surface patch faces and nodes -%% perform mesh generation -[node,elem,face]=surf2mesh(v,f,[1 1 1],[100 100 100],0.1,25); - -%% visualize the resulting mesh -plotmesh(node,face(:,1:3)); -axis equal; diff --git a/ext_libs/iso2mesh/sample/demo_surf2vol_ex1.m b/ext_libs/iso2mesh/sample/demo_surf2vol_ex1.m deleted file mode 100755 index 49812a34c..000000000 --- a/ext_libs/iso2mesh/sample/demo_surf2vol_ex1.m +++ /dev/null @@ -1,60 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script to convert a closed surface to a binary image -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -%% load the sample data -load rat_head.mat - -% first, generate a surface from the original image -% similar to demo_shortcuts_ex1.m - -[node,face,regions,holes]=v2s(volimage,0.5,3); - -node=sms(node,face(:,1:3),3,0.5); % apply 3 mesh smoothing - -mdim=ceil(max(node)+1); -dstep=0.25; -zslice=15; -xrange=0:dstep:mdim(1); -yrange=0:dstep:mdim(2); -zrange=0:dstep:mdim(3); -img=surf2vol(node,face(:,1:3),xrange,yrange,zrange); - -imagesc(squeeze(img(:,:,zslice))); % z=10 - -hold on - -z0=zslice*dstep; -plane=[min(node(:,1)) min(node(:,2)) z0 - min(node(:,1)) max(node(:,2)) z0 - max(node(:,1)) min(node(:,2)) z0]; - -% run qmeshcut to get the cross-section information at z=mean(node(:,1)) -% use the x-coordinates as the nodal values - -[bcutpos,bcutvalue,bcutedges]=qmeshcut(face(:,1:3),node,node(:,1),plane); -[bcutpos,bcutedges]=removedupnodes(bcutpos,bcutedges); -bcutloop=extractloops(bcutedges); -bcutloop(isnan(bcutloop))=[]; % there can be multiple loops, remove the separators -plot(bcutpos(bcutloop,2)*(1/dstep),bcutpos(bcutloop,1)*(1/dstep),'w'); - -if(isoctavemesh) - if(~exist('bwfill')) - error('you need to install octave-image toolbox first'); - end - img2=zeros(size(img),'uint8'); - for i=1:size(img,3) - img2(:,:,i)=bwfill(img(:,:,i),'holes'); - end - img2=img2+img; -else - img2=imfill(img,'holes')+img; -end -figure; -imagesc(squeeze(img2(:,:,zslice))); % z=10 -hold on; -plot(bcutpos(bcutloop,2)*(1/dstep),bcutpos(bcutloop,1)*(1/dstep),'y--'); diff --git a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1.m b/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1.m deleted file mode 100755 index 54e9ec48e..000000000 --- a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1.m +++ /dev/null @@ -1,29 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for mesh generation from binarized volumetric image -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -% A,b are registration matrix and vector, respectively -%% perform mesh generation - -[node,elem,face]=vol2mesh(volimage>0.05,1:size(volimage,1),1:size(volimage,2),... - 1:size(volimage,3),2,2,1); - -%% alternatively, one can use the following cmd as a less robust approach -% [node,elem,face]=vol2mesh(volimage>0.05,1:size(volimage,1),1:size(volimage,2),... -% 1:size(volimage,3),0.2,2,1,'simplify'); - -%% visualize the resulting mesh - -plotmesh(node,face); -axis equal; diff --git a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1b.m b/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1b.m deleted file mode 100755 index cb54b2d3d..000000000 --- a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1b.m +++ /dev/null @@ -1,30 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for mesh generation from binarized volumetric image -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -% A,b are registration matrix and vector, respectively -%% perform mesh generation - -%% use the alternative 'simplify' method: first create voxel-based -% surface mesh, and then resample it to desired density. -% this method does not guarantee to be free of self-intersecting -% element, as 'cgalsurf' promises. - -[node,elem,face]=vol2mesh(volimage>0.05,1:size(volimage,1),1:size(volimage,2),... - 1:size(volimage,3),0.1,2,1,'simplify'); - -%% visualize the resulting mesh - -plotmesh(node,face); -axis equal; diff --git a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1c.m b/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1c.m deleted file mode 100755 index 0f05ee3b3..000000000 --- a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex1c.m +++ /dev/null @@ -1,30 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% demo script for mesh generation from binary volumetric image -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%% preparation -% user must add the path of iso2mesh to matlab path list -% addpath('../'); - -% user need to add the full path to .../iso2mesh/bin directory -% to windows/Linux/Unix PATH environment variable - -%% load the sample data -load rat_head.mat - -% volimage is a volumetric image such as an X-ray or MRI image -% A,b are registration matrix and vector, respectively -%% perform mesh generation - -%% use the alternative 'cgalmesh' method. This will call -% cgalmesher to process labled volume to produce surfaces -% and tetrahedral mesh in a single run. -clear opt -opt.radbound=2; -[node,elem,face]=v2m(uint8(volimage),0.5,opt,100,'cgalmesh'); - - -%% visualize the resulting mesh - -plotmesh(node,face(:,1:3)); -axis equal; diff --git a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex2.m b/ext_libs/iso2mesh/sample/demo_vol2mesh_ex2.m deleted file mode 100755 index 0dc0493f9..000000000 --- a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex2.m +++ /dev/null @@ -1,24 +0,0 @@ -% sample script to create volumetric mesh from -% multiple levelsets of a binary segmented head image. -% -% Author: Qianqian Fang - -% load iso2mesh image - -img=imread('iso2mesh_bar.tif'); -img=fliplr(img); -fullimg=repmat(1-img,[1,1,30]); -fullimg(:,:,31:60)=repmat(ones(size(img)),[1,1,30]); - -% create volumetric tetrahedral mesh from the two-layer 3D images -% this may take another few minutes for a 256x256x256 volume -clear opt -opt.keepratio=0.1; % this option is only useful when vol2mesh uses 'simplify' method -opt.radbound=3; % set the target surface mesh element bounding sphere be <3 pixels in radius. -tic -[node,elem,face]=vol2mesh(fullimg,1:size(fullimg,1),1:size(fullimg,2),1:size(fullimg,3),opt,100,1); -toc - -hb=plotmesh(node,face); -axis equal -view(-90.5,-72); diff --git a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex3.m b/ext_libs/iso2mesh/sample/demo_vol2mesh_ex3.m deleted file mode 100755 index e26d67d68..000000000 --- a/ext_libs/iso2mesh/sample/demo_vol2mesh_ex3.m +++ /dev/null @@ -1,53 +0,0 @@ -% sample script to create volumetric mesh from -% multiple levelsets of a binary segmented head image. -% -% Author: Qianqian Fang - -% load full head image (T1 MRI scan) - -fprintf(1,'loading binary head image...\n'); -for i=1:256 - head(:,:,i)=imread('head.tif',i); -end - -% load segmented brain images (by freesurfer recon_all) -fprintf(1,'loading binary brain image...\n'); -for i=1:256 - brain(:,:,i)=imread('brain.tif',i); -end - -% fill holes in the head image and create the canonical binary volume -% this may take a few minutes for a 256x256x256 volume -fprintf(1,'filling holes in the volumetric images...\n'); -tic -cleanimg=fillholes3d(logical(head>0),10); -cleanbrain=fillholes3d(logical(brain>0),10); -toc - -% add brain image as additional segment -cleanimgfull=cleanimg+(cleanbrain>0); - -% create volumetric tetrahedral mesh from the two-layer 3D images -% this may take another few minutes for a 256x256x256 volume -clear opt; - -% set method for vol2mesh to 'simplify' to use these option -opt(1).keepratio=0.05; % resample levelset 1 to 5% -opt(2).keepratio=0.1; % resample levelset 2 to 10% - -% by default, vol2mesh uses 'cgalsurf' method, which requires the following -opt(1).radbound=4; % head surface element size bound -opt(2).radbound=2; % brain surface element size bound -opt(1).side='lower'; % -opt(2).side='lower'; % - -tic -[node,elem,face]=vol2mesh(cleanimgfull,1:size(cleanimg,1),1:size(cleanimg,2),1:size(cleanimg,3),opt,100,1); -toc - -% plot the boundary surface of the generated mesh -h=slice(cleanimgfull,[],[120],[120 180]); -set(h,'linestyle','none') -hold on - -plotmesh(node(:,[2 1 3]),face,'facealpha',0.7); diff --git a/ext_libs/iso2mesh/sample/head.tif b/ext_libs/iso2mesh/sample/head.tif deleted file mode 100755 index d5011af6d..000000000 Binary files a/ext_libs/iso2mesh/sample/head.tif and /dev/null differ diff --git a/ext_libs/iso2mesh/sample/iso2mesh_bar.tif b/ext_libs/iso2mesh/sample/iso2mesh_bar.tif deleted file mode 100755 index cf4b06c85..000000000 Binary files a/ext_libs/iso2mesh/sample/iso2mesh_bar.tif and /dev/null differ