06-27-2020 04:18 PM
yes i know the code is not super optimised the light does not have the be in the for loop , the for loops can be simplified i was just translating my matlab code into labview and was debugging things along the way. you can find attached the subVI's and a data set to read.
The data sets are ussually a bit big so i uploaded a small set.
06-27-2020 04:19 PM
when running the VI you should see the following as shown in the picture.
06-27-2020 05:28 PM
You said "find the maximum in this plane". It seems you want to actually show the projection of the data into each plane, i.e. get the sum of all planes in each direction, display it, and show the maximum. My code just shows the max in each direction.
Still, you really need to learn about array operations and polymorphism. For example your subVI that scales the data is just pure Rube Goldberg. (and there is no reason to maximize a front panel containing two small indicators to the full screen!). Taking a subset of the original size starting at zero is a noop and operating on each array element with the same value does not need matching arrays!!!
You also need to set the browse option of the path control to "existing folder".
06-27-2020 05:48 PM
@zak9001 wrote:
I am working with a 3D ultrasound volume data set like the one shown in the attachment. I would like to project the maximum value or in other words the maximum intensity projection of the top , front and side views, In the XY plane , i project the maximum from Z in depth . In the front YZ plane i project the maximum in the X depth and finally in the side plane XZ i project the maximum in the Y depth.
OK could you clarify. so if you look at all xy planes, you can create an image of the same size as one plane, where each pixel either contains the maximum value for each z column at a give xy or the sum of all values in each column. Typically in a "projection" all voxels contribute, not just the max.
06-27-2020 06:13 PM
Attached is an example of the 2d maximum intensity projections performed in matlab and also a 3D projection.
I have a 3D array and i wish to project the maximum values in each 3D direction . TOP is the XY plane with the maximum in Z projected in a 2D image . Front is the YZ plane with the maximum in X projected in a 2D image and Side is the XZ plane with the maximum in Y projected in a 2D image.
Since the size of X ,Y and Z are different the size of the each 2D plane projection will be different
Y has 34 elements
X has 2000 elements
Z has 700 elements
hence
the XY 2D plane will be 2000x34 elements with the maximum in Z projected
the YZ 2D plane will be 34x700 elements with the maximum in X projected
the XZ 2D plance will be 2000x700 elements with the maximum in Y projected
06-27-2020 06:22 PM
See if this can give you some ideas.
06-28-2020 04:39 AM
Thanks thats exactly what i needed! also thanks for tidying up some stuff!
06-28-2020 07:16 PM
@zak9001 wrote:
... also thanks for tidying up some stuff!
Sorry, I just scraped the tip if the iceberg. The code could probably be reduced to <50% with a bit more effort. 😉