Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to view image in sagittal, coronal and axial view in labview

Solved!
Go to solution

Handling 3D images well in LabVIEW takes a bit of effort - if you're not careful, LabVIEW will make copies of your array and that can lead to out-of-memory issues very quickly,

 

Based on your screenshot (you're better to attach the code itself) here's a few things to try:

  • looks like your images are U16 - make the Volume array U16 as well -- you have no need for DBLs which take much more memory to store
  • do NOT use local variables at all - wire the 3D array through (with shift registers on the For loop), and similarly wire all other variables directly

That should get you working for now, even in 32-bit LabVIEW (512x512x512xU16 = 256MB), but do keep careful track of your memory allocation.  Use Tools/Profile/Show Buffer Allocations... to show where LabVIEW is allocating memory, and see if you can eliminate as many of those as possible.

Message 11 of 18
(4,365 Views)

Thanks a lot I guess there is memory issue with my system.

 

Here I am attaching code .

0 Kudos
Message 12 of 18
(4,362 Views)
Solution
Accepted by topic author parag77

@Klemen wrote:

Hello,

 

since the subject is not moving, I would suggest choosing a reference image (the first image, or possibly the slice with the greatest area) and draw a line ROI so that it is coplanar with the desired plane. Loop through all the indices of the line ROI and extract the intensity of the image along the line ROI. Write the intensities in a array/image to the first column (or row). Repeat for all slices incrementing the column/row.

 

Best regards,

K


Hello,

 

I was thinking about something like this.

 

Example_VI_BD.png

 

You could initialize array before looping instead of building it, if you have a lot of data.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 13 of 18
(4,354 Views)

I really appreiate help from you guys.  Smiley Happy

 

Here I am attaching my working code.

Download All
0 Kudos
Message 14 of 18
(4,342 Views)
Solution
Accepted by topic author parag77

A 512x512x512 3D array of U16 should only take 256 MB of memory if you do it right.  Try this:

 

Loop through the image file names.  For each image, load image and convert to array.  Wire the array out of the loop.  This will only load one image at a time, so it should be efficient.  Wire the 3D array into a while loop, where you extract the desired 2D plane, convert it to an image, and display it.  Your main memory usage would be one 3D array and four 512x512 images.

 

Example.png

Bruce

Bruce Ammons
Ammons Engineering
Message 15 of 18
(4,330 Views)

Thanks a lot . This is really really awsome and very fast .Smiley Happy

0 Kudos
Message 16 of 18
(4,321 Views)

Further thoughts:

 

For the selector for each image in the while loop, you can use a slider.  A very easy way to scan through the images quickly.

 

If you are using the same set of images repeatedly, you can reduce the load time by saving the 3D array to a binary file, then loading the binary file in a separate vi for viewing.

 

For smoother transitions between images while moving the slider, you can decrease the loop timer.  Just don't remove it or your CPU usage will go to 100%.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 17 of 18
(4,316 Views)

please i would appreciate if you can help, how can i convert an axial image to sagatial in dsi studio?

0 Kudos
Message 18 of 18
(1,579 Views)