SCIRun User Mailing List

Text archives Help


Re: [SCIRUN-USERS] streamlines with nrrd vector field data


Chronological Thread 
  • From: Jess Tate <jess@sci.utah.edu>
  • To: "Brad Hollister" <behollis@sci.utah.edu>
  • Cc: scirun-users@sci.utah.edu
  • Subject: Re: [SCIRUN-USERS] streamlines with nrrd vector field data
  • Date: Wed, 25 May 2016 17:41:24 -0600

HI Brad,

You can set any points as seeds for the streamlines, assuming that they are
within the vector field. There are some seed generate modules that can be
used to sample the vector fields various ways. If you have specific points
that you want as seeds, you can set them as the seed points, though it may be
tricky getting them in the correct format for the module. The
generatestreamlines module needs the seed points as a point cloud mesh. if
you have a list of 3D locations for seed points, it is simply a matter of
loading them into scirun and using them. If you want to extract seed points
from a field by node number, this can be trickier.

If the number of nodes to extract is a small number, you can convert the mesh
to a point cloud then use ClipFieldByFunction. The expression INDEX==0; will
extract only the first node. to get multiple nodes, you can use the boolean
operators: INDEX==0 || INDEX==1 || INDEX==2 || …;. Additionally, you can
get point ranges very easily: INDEX>=0 && INDEX<=5; will get node 0 through
5 inclusive. For regularly sampling the nodes, every 5th node for example, I
will use an expression like this: floor(INDEX/5)==(INDEX/5);. However, if
you want regularly sampled points from a regular grid, the
GenerateSamplePointsFromFieldOrWidget does a good job of that too.

If the list of nodes to extract is large and not regular, the previous
examples can be impractical. The best way is to mark each node in the mesh
(convert it to point cloud first) to clip with a binary label, that is, label
all the nodes to keep as 1 and the rest as 0. You can use
ClipFieldByFunction (DATA==1;) to extract them. If have the node indices
saved as a array, it is best to convert them to mask array with the
InterfaceWithMatlab/Python, then use SetFieldData to assign it to the mesh.

Using the get GetFieldNodes module will only give you the matrix of the
points. To get the nodes of the field as a point cloud, use
ConvertMeshToPointCloud.

cheers,
Jess





On May 25, 2016, at 5:02 PM, Brad Hollister <behollis@sci.utah.edu> wrote:

> Is there a simple network available for loading a vector field in the nrrd
> file format, seeding a specified location for streamline generation, then
> visualizing the result?
>
> I've tried the following:
>
> ReadField -> GetFieldNodes -> GenerateStreamLines -> ShowField -> ViewScene
>
> However, there doesn't appear to be a way to specify a particular node for
> seeding, or a way to connect the nodes to the GenerateStreamLines module.
>
> If you need any files from me to clarify an answer, please let me know.
>
> Regards,
> Brad
>
> ________________________________________________
> 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.

Top of page