SCIRun User Mailing List

Text archives Help

Re: [SCIRUN-USERS] Biomesh3D resulting mesh shifted

Chronological Thread 
  • From: Hon Fai Choi <>
  • To: Brett Burton <>
  • Cc: Petar Petrov <>, Jess Tate <>, "" <>
  • Subject: Re: [SCIRUN-USERS] Biomesh3D resulting mesh shifted
  • Date: Sat, 31 May 2014 17:48:45 +0200

Thanks all very much for the input! I actually already subsample the
image, but I have to subsample a lot before obtaining a reasonable
computation time.
Brett, it would be great if you could forward some descriptions of
your workflow combining BioMesh and Cleaver. I wasn't aware of
Cleaver, but it looks like a nice tool. I don't seem to get your
attachments though; I didn't get the SCIRun network you attached in
your previous email.

thanks again for all the feedback,

Hon Fai

On Sat, May 31, 2014 at 5:15 PM, Brett Burton <>
> I actually use a combination of BioMesh and Cleaver (also available through
> SCI). It is a much more complicated pathway and requires both a SCIRun
> change in the sizing field as well as a transformation after the mesh is
> complete (also in SCIRun), but it reduces the length of meshing by quite a
> bit (though you will need a machine with a lot of RAM for big meshes) and
> it provides a more structured mesh - which makes it faster to read once
> it's done. If you're interested, I can forward some instructions to you on
> this method.
> Brett
> On May 31, 2014, at 3:55 AM, Petar Petrov <> wrote:
>> "
>> There are two parameters in the parameter file that
>> control the sizing field
>> "
>> if you are referring to MAX_SIZING_FIELD and SIZING_SCALE_VAR, only
>> the first one is accepted !
>> So in practice there is one parameter, which is: MAX_SIZING_FIELD.
>> I'm working on my own version of BioMesh3D and planning to introduce
>> MAX_SIZING_FIELD not as a scalar but as a gradient to better control
>> adaptive nature of the mesh.
>> As it stands it is barely useful for my meshes (human/rat brain) as
>> Stage6 is a huge!!! bottleneck ... it takes week for 1process to
>> finish!!!
>> On Fri, May 30, 2014 at 8:31 PM, Jess Tate <> wrote:
>>> Hi,
>>> There are two parameters in the parameter file that
>>> control the sizing field, which influences the size of the mesh elements.
>>> Increasing either of these should increase the size of the elements.
>>> However, there is an additional consideration, since the smallest
>>> elements are supposed to be there to represent small features. If you
>>> want to increase the minimum size of the elements, you will lose some of
>>> these features. If you are ok with that, the easiest way to increase the
>>> element size is to smooth the original segmentation or downsample it.
>>> downsampling will also speed up the entire pipeline.
>>> cheers,
>>> Jess
>>> On May 30, 2014, at 10:27 AM, Brett Burton <> wrote:
>>>> Hon,
>>>> There is a .tf parser in the C++ code that runs in the background of the
>>>> python scripts. About 2 weeks ago, I also tried to figure this out, but
>>>> I am much more skilled in SCIRun, so I gave up and transformed it using
>>>> SCIRun. We could probably figure this out in a day or two and it would
>>>> also probably be better, let me talk to Jess about it.
>>>> Sizing field min value scaling:
>>>> The parameters in the BioMesh config file does not allow for a minimum
>>>> size restriction, but you can control this by altering your sizing field
>>>> files ([YourFile]_sf.nrrd]). You can use SCIRun to open this sizing
>>>> field file (ReadField module with the nrrd filetype selected). Then use
>>>> the CalculateFieldData module. In the UI of this module you can scale
>>>> and translate the sizing field data. For example, lets say your sizing
>>>> field goes from 0.5 to 12. You can use a statement like DATA = DATA+2;
>>>> to get your new sizing field to run from 2.5 to 14. You can then save
>>>> this file out again as a nrrd and replace the sizing field in your
>>>> BioMesh output folder. I've attached a network as an example. If you
>>>> have multiple materials, you may want to run this network multiple
>>>> times, or duplicate the modules within the network.
>>>> Brett
>>>> <ChangeSizingField.srn><Heart_sf.nrrd>
>>>> On May 30, 2014, at 2:19 AM, Hon Fai Choi <> wrote:
>>>>> Hi Jess and Brett,
>>>>> thank you very much for the suggestions. The shift that I have is
>>>>> quite large, I have attached a picture as illustration. Could you also
>>>>> tell me how I can read the .tf file? I tried to open it with Wordpad,
>>>>> but it seems to be a binary file.
>>>>> I have also an additional question regarding BioMesh3D. Is there a way
>>>>> that I can put a threshold on the minimal size of the mesh elements? I
>>>>> have followed the user documentation and the input parameter for the
>>>>> element size seems to only limit the maximal size of the elements.
>>>>> thanks,
>>>>> Hon Fai
>>>>> On Thu, May 29, 2014 at 8:51 PM, Brett Burton <> wrote:
>>>>>> Like Jess implied, Biomesh transforms the original segmentation into a
>>>>>> different coordinate space in order to generate the original mesh.
>>>>>> during this first transformation, it creates a transformation file
>>>>>> ([FileName] It uses this transform to shift the
>>>>>> heart back, but as you may notice by the name of the .tf file, Biomesh
>>>>>> also pads your data. If you are finding that this shift is very
>>>>>> slight, it is probably due to the padding. Jess's approach will work,
>>>>>> in both cases, to get you aligned again.
>>>>>> Let us know if you have further questions
>>>>>> Brett
>>>>>> On May 29, 2014, at 12:38 PM, Jess Tate <> wrote:
>>>>>>> Hi,
>>>>>>> BioMesh should transform the final mesh back into the original space.
>>>>>>> Look for the particle-union.tets-labeled_transformed.fld file. If
>>>>>>> it is not there, then the last step didn't finish. If the file is
>>>>>>> not there or is still the wrong size or origin, you can fix it pretty
>>>>>>> easily in SCIRun. Load in the mesh and original segmentation.
>>>>>>> extract the surface of one of the regions in the segmentation (or all
>>>>>>> of them) with GetDomainBoundary. Then use
>>>>>>> SplitFieldByConnectedRegion or SplitFieldByDomain to remove any
>>>>>>> excess space around the tet mesh from BioMesh. Then use
>>>>>>> AlignMeshBoundingBox to align the tet mesh to the segmentation
>>>>>>> surface. This module will also give you the transformation used if
>>>>>>> need for other meshes.
>>>>>>> cheers,
>>>>>>> Jess
>>>>>>> On May 29, 2014, at 2:55 AM, Hon Fai Choi wrote:
>>>>>>>> Hi all,
>>>>>>>> I have a question regarding Biomesh3D. I use Seg3D to create the
>>>>>>>> segmentations and save them as .nrrd files as input to Biomesh3D.
>>>>>>>> When
>>>>>>>> I export the resulting mesh with SciRun as a .vtk file and compare it
>>>>>>>> with the original image, then the mesh is not in the right location.
>>>>>>>> It's somehow shifted relative to where it should be. Has anyone
>>>>>>>> encountered the same problem and knows how to fix this?
>>>>>>>> thanks,
>>>>>>>> Hon Fai
>>>>> <shifted_mesh.png>
>> --
>> All the best,
>> Petar Petrov

Archive powered by MHonArc 2.6.18.

Top of page