SCIRun User Mailing List

Text archives Help

[SCIRUN-USERS] Re: Re: Re: Clip Field by Surface.

Chronological Thread 
  • From: Seok Lew <>
  • To: Sanket Jain <>
  • Cc: David Weinstein <>, Darrell Swenson <>, SCIRUN Users Mailing List <>
  • Subject: [SCIRUN-USERS] Re: Re: Re: Clip Field by Surface.
  • Date: Fri, 25 Feb 2011 14:21:54 -0500

Hi Sanket,

The freesurfer surface has self-intersecting planes.  When you create tetrahedral meshes out of the surface, you will come up with the invalid PLC problem in tetgen.  You should resuface the freesurfer surface before the tetgen to avoid the problem.   Usually you can create a volume mesh with the freesurfer surface mesh, and then try to get the surface mesh from the volume mesh by a meshing tool other than the freesurfer.   


On Feb 24, 2011, at 7:41 PM, Sanket Jain wrote:

Hi Dave,

Nice to hear from you. Hope you are doing great. I got the brain trisurf from another engineer in the lab. As far as I know, the surface was generated using freesurfer. If you need any more details, let me know. I shall forward it to you tomorrow.


On Thu, Feb 24, 2011 at 5:58 PM, David Weinstein <> wrote:
Hi Sanket,

As Darrell suggested, this is possible -- but it's also somewhat computationally challenging.  In fact, I've run into the same exact problems as you have when I recently tried this.  Any chance that the brain trisurf was generated by extracting the boundary of a label map (e.g. something from Seg3D or Slicer)?  If so, it's *much* easier to clip the fibers to the label map volume -- if that's the case, I'd be happy to walk you through how to do it.


On Feb 24, 2011, at 4:33 PM, Sanket Jain wrote:

Thanks for your reply Darrell. I have tried your suggestions but no luck as of now.

1) I am not sure how would I verify if the brain surface is completely closed. I assumed it is closed and went ahead with meshing the surface. When I used the default parameters in interfacewithtetgen, I encountered the following error:

Error:  Invalid PLC.
Two subfaces (143073, 84920, 141454) and (85834, 84920, 84930) are found intersecting each other.
Hint:  Use -d switch to find all intersecting facets

Based on the hint, I activated -d switch. For this I had to turn off -q switch because -q and -d cannot be used together according to another error. On doing so, I got the surface meshed. I verified the output of InterfaceWithTetGen as 'TetVolMesh' Type.

2) I connected the mesh to 2nd input of ClipFieldtoFieldOrWidget (ClipField) while the fibers (curvefield) were connected to 1st input (Input Field). The output was always an empty field. I played around with all 3 "locations to test". The output was empty in all the cases.

Field Data basis for both mesh and fibers was Linear before passing to ClipFieldtoFieldorWidget. In theory, this approach looks correct to me. Do you have any idea why this wont be working?


On Thu, Feb 24, 2011 at 3:25 PM, Darrell Swenson <> wrote:
If your brain surface is completely closed or "water tight" then it is not too hard.  There are several ways, but the easiest is to simply create a volumetric mesh and then clip you fiber field to your brain mesh.  So this would look like:

Brain field goes to

interfacewithtetgen  (the default params should work in this case)

fiber field and output tet mesh of brain goes to


resulting in a clipped fiber field.

Good luck,


On Thu, Feb 24, 2011 at 1:52 PM, Sanket Jain <> wrote:
Hello Folks,

Is there any way to crop a scirun field with respect to scirun tri-surface? In my case, I have a brain surface (trisurf field) and fibers(field, output of tend fiber module). Some part of the fiber is outside the brain surface while most of it is inside the surface. I want to crop the part of the fiber which is outside the surface while retaining the part of the fiber which is inside the surface.

Let me know if you require anything to help me out.

Sanket Jain

Sanket Jain

Sanket Jain

Archive powered by MHonArc 2.6.16.

Top of page