Mariano,I've written up an appendix to the tutorial that I sent out earlier and have attached it to the email (as well as copied the text into the email below). This appendix should address your first question regarding combining multiple sizing fields. To expedite your implementation of the Appendix, I've also attached an example SCIRun network that combined 7 sizing fields.Next, question b). Smoothness of the final mesh is not determined by the sizing field. The sizing field defines how coarse or refined your final mesh will be, but the mesh surfaces will conform to the original inputs you used to define your volumes. So if your input volumes are coarse, the final mesh will be course. To create smooth meshes, you will need to pass the original segmentation file through BioMesh3D and use the tight.nrrd outputs. In the tutorial, it states that you should use tight-corrected.nrrd outputs. This may be wrong, if I remember right, the tight.nrrd files are the final output of the BioMesh tightening step.Consequently, Cleaver2 has implemented the first 4 stages of BioMesh, but you will need to have a SCIRun 4 build and the complete Qt5 package installed in order to use it.BrettAppendix A: Combining multiple sizing fields (from 4.4.b)Combining multiple sizing fields may be difficulty given that you need to scale and translate multiplefiles while making sure that the sizing fields, at the intersecting surfaces of neighboring tissues, are thesame.To do this you will need:- each of the individual sizing fields for each tissue of interest- the segmentation file (preferably aligned to the sizing fields, though this can be transformed if theyare not aligned).1 - Open SCIRun2 - Load segmentation and sizing field files (nrrdsa. Modules -> DataIO -> ReadField moduleb. Click UI button (User Interface) on modulec. Change 'Files of Type' drop down to NrrdFiled. Select nrrd file (segmentation file, not distance maps)3 - Extract Min value of sizing field filesa. Modules -> Misc -> ReportFieldInfo4 - Translate and Scale Sizing fields using Min sizing field valuesa. Modules -> ChangeFieldData -> CalculateFieldDatab. Connect original Sizing field output to modulec. Connect ReportFieldInfo output port corresponding to Min data value (4th port from the left)to matrix input portd. Translate and Scale Datai - Simple case -- no max sizing field constraintRESULT = .25*(DATA - A) + .75;-- TranslationDATA is the original sizing fieldA is the min matrix value(DATA - A) zeros out the sizing field (translates to 0)-- Scaling.25 is the scaling factor (reducing the original sizing field by 1/4)-- Additional Translation.75 translates the sizing field again so that the min sizing field is 0.75This MUST be done so that you don't have a 0 value for sizingThis would crash cleaverYou could also replace the .75 with a second input matrixTo do this you would have to use the CreateMatrix module todefine your min value. If you did this, your equation would beRESULT = .25*(DATA - A) + B;ii - With max sizing field constraint -- this combines 4.4.b and 4.7.cNEWDATA = .25*(DATA - A) + .75;RESULT = select(NEWDATA>=1.0,1.0,NEWDATA);-- TranslationDATA is the original sizing fieldA is the min matrix value(DATA - A) zeros out the sizing field (translates to 0)-- Scaling.25 is the scaling factor (reducing the original sizing field by 1/4)-- Additional Translation.75 translates the sizing field again so that the min sizing field is 0.75This MUST be done so that you don't have a 0 value for sizingThis would crash cleaverYou could also replace the .75 with a second input matrixTo do this you would have to use the CreateMatrix module todefine your min value. If you did this, your equation would beRESULT = .25*(DATA - A) + B;-- CappingThe final RESULT scans the data to find the max value you want todefine. If it is above 1.0 (in this case) you will set the value to 1.0otherwise, it will maintain the original value5 - Combining Sizing FieldsThe modules you use here are dependent on how many sizing fields you want to combine. Inthis example, we will have 7 sizing fields to combine. This number is chosen to illustrate theneed for multiple linked modules. If there are less than 4 modules, the steps a - c are all youneed. If you have more than 8 you will need to repeat steps d - fa. Modules -> ChangeFieldData -> CalculateFieldData5b. Connect segmentation field and 1st 4 modified Sizing fields outputs to module input portsc. Combine first 4 sizing fieldsRESULT = select(DATA1==0,-DATA2,select(DATA1 == 1,-DATA3,select(DATA1 == 2,-DATA4,select(DATA1 == 3,-DATA5,DATA1))));-- DATA1 is the segmentation (0 = air, 1 = tissue 1, 2 = tissue 2, etc...)-- DATA2 is sizing field for air (DATA1 == 0)The value is set to negativeThis is done to prevent the results from having values that later matchthe segmentation values of 1, 2, 3, 4Negative values will not be segmentation label values-- DATA3 is sizing field for tissue 1 (DATA1 == 1)-- DATA4 is sizing field for tissue 2 (DATA1 == 2)-- DATA5 is sizing field for tissue 3 (DATA1 == 3)d. Combine additional 3 sizing fieldsi. Modules -> ChangeFieldData -> CalculateFieldData4RESULT = -select(DATA1==4,-DATA2,select(DATA1==5,-DATA3,select(DATA1==6,-DATA4,DATA1)));-- DATA1 is the output of the previous-- notice that there is a negative in front of select() functionthis restores the sizing fields back to positive values.6 - Optional additional translationSometimes their is further need to translate the entire field if your original translation was notlarge enough to make sizing fields of a reasonable value...to do this, open a newClipFieldByFunction using the output of the above step as the input and use the functionRESULT = DATA + [whatever value you want];7 - Write out fielda. Modules -> DataIO -> WriteField moduleb. Click UI button (User Interface) on modulec. Change 'Files of Type' drop down to NrrdFiled. Select nrrd file (segmentation file, not distance maps)On Mar 17, 2016, at 3:07 PM, Elizabeth Jurrus <liz@sci.utah.edu> wrote:Hi everyone,<Plus5.png><tetgen_in_SCIRun.png><Plus3.png>
I'm adding cleaver to this mailing list to help with the windows crash in 3, below, and the sizing field parameters.
And I'm adding the scirun-users mailing list to help with sizing fields in SCIRun.
- liz
-------- Forwarded Message --------
Subject: Re: Biomesh3d client Date: Thu, 17 Mar 2016 15:44:05 -0300 From: Mariano Fernandez <marianofco@gmail.com> To: Moritz Dannhauer <moritz@sci.utah.edu> CC: Sergei Turovets <sturovets@yahoo.com>, Dana Brooks <brooksdh@gmail.com>, Rob MacLeod <macleod@sci.utah.edu>, Elizabeth Jurrus <liz@sci.utah.edu>
Thanks again,1) The tetgen implementation in SCIRun 5 provided by Moriz runs with no errors. The resulting surfaces of the mesh are rather "voxelized" (not smooth, see attached). I tried to include smoothing (as described in the tutorial file in point 2.5) but the tetgen fails because of self intersecting facets, which is expected as described in your help (http://scirundocwiki.sci.utah.edu/SCIRunDocs/index.php/CIBC:Documentation:SCIRun:Reference:SCIRun:FairMesh). That's a known limitation of tetgen.Dear Moritz and Rob,Thanks for your help. I found your tutorial "Meshing methods and instructions" were instructive.
This what I've tried until now (also for your records / debug):
2) Biomesh alone (third method) is too slow (still running).
3) Cleaver + biomesh seems to be the best world (method number 4) in terms of quality elements, smooth surfaces and speed. I created the Sizing fileds using biomesh3d with the -s1:4 switch (as described in the tutorial). However, I couldn't make cleaver run in windows: in the verbose mode, and after "Creating Octree Mesh ..." the program terminates with no reason and no output.
So, I installed and compiled cleaver in a Virtual Machine with ubuntu 64 bits. I generated the sizing field with the Cleaver-gui and exported it as nrrd file. Then, in SCIRun I changed it by adding 1, 2, 3, 4, 5, and 10 units (as described in point 4.7.c). It works with plus3, plus4, plus5, and plus10. When adding one or 2, or even using the original unmodified Volume-sizing-field, cleaver crashes (just a "Killed" mesage on prompt) I assume it is because of memory requirements.
So, a couple of questions:
a) In point 4.4.b it says that "more info available if needed" in order to combine sizing fields. I would like to know how to combine the individual tissue sizing fields in SciRun to control them independently. So far, I've been only changing the full already combined and cleaver generated "volume sizing field".
b) The gray matter surfaces are still not as smooth as I would like (see "dents" in attached figures) and there is not much variation between "volume sizing field +5" and "volume sizing field +3" (see attached). Are these two effects expected? With lower sizing fields, is it expected that the GM surface gets smoother? Or is it already determined by the segmentation?
Best regards,
Mariano.
2016-03-14 13:23 GMT-03:00 Moritz Dannhauer <moritz@sci.utah.edu>:
Hi Mariano, I will let you know once they bug-fixed it.
Find attached also some responses from another SCI user regarding your cleaver2 error messages and a short tutorial.
Best,
Moritz
On Mar 14, 2016, at 9:40 AM, Mariano Fernandez wrote:
> Thanks Moritz,
>
> Actually, tetgen is what I use (within the iso2mesh Matlab toolbox), but I will try your SCIRun 5 implementation. Please, let me know when you consider Cleaver 2 is ready.
>
> Bests,
>
> Mariano.
> It seems like this user is thinking that a coarse mesh would be more likely to complete. That doesn't seem to be the case given the "default binary_dir = Model configuration file Files\SCIRun does not exist." line in his error message. Besides, his computer would crash long (from memory hogging) before a week was up if Cleaver was working.
>
> In any case, here's a write-up of meshing steps that can be used, though I admit…I don't know much about using it on a windows machine. This should still be up to date.
>
>
>
> Also…does he have the Cleaver documentation? That would be able to explain the flags that he was asking about, but he should be aware that you can't define how many elements the mesher produces. You have to set scaling parameters such that they create a coarser mesh, but you don't have direct control over the total number of elements, or the dimensions of them.
________________________________________________
SCIRun users mailing list: scirun-users@sci.utah.edu
http://www.sci.utah.edu/software/scirun.html
To unsubscribe, email sympa@lists.sci.utah.edu with the "unsubscribe scirun-users" in the message body.
Archive powered by MHonArc 2.6.18.