LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving image data to text file - multiple columns

Solved!
Go to solution
Hi,

I'm currently grabbing images using IMAQ functions and am computing the average of each image across the columns using IMAQ LinearAverages.vi. I am currently saving these values (ie a line profile size 1:N) to a text file. However I have a large amount of images (M) to capture, so I would like to output each image line profile data to an individual column.

At the moment the text file captures all data but in a single column-not very useful for post-processing purposes. Can anyone suggest a nice way of doing this? Is saving to a spreadsheet file better?

I'd appreciate any advice.

Kind regards,
Miika
0 Kudos
Message 1 of 15
(6,531 Views)

I'm not sure I fully understand what you're doing in your VI could you post some code to show exactly what you do so we can come up with appropriate ideas?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 15
(6,529 Views)

Hi TiTou,

 

Apologies for the delay; I have been at a conference meeting with limited internet. I hope you can still help me.

In the attached screen shot you can see the for loop within which I am saving the data to a text file - the N of the loop corresponds to how many images I wish to capture.  In this I am capturing an image with IMAQ, then I average along each column to obtain a line profile for this image and then these values I save to a text file.  However, the file is very big and it would make much more sense to save each line profile in a separate column rather then one after another. 

 

Averaging across the columns yields 1024 values (fixed). If I capture 1000 images and save each value, I would be ending up with 1000*1024 values, one after another in a .txt file.  It would be much easier for postprocessing if info from each image was in a separate column.

 

Any comments/suggestions are welcome!

 

Kind regards,
Miika

0 Kudos
Message 3 of 15
(6,507 Views)

Hi,

Sorry for coming back to you so late.

If you don't absolutely need a txt file I suggest to use TDMS files to save your data (binary file but you can open them in Excel if you install this), the advantage I see in this option is that you will have one column per image.

 

Example_VI_BD.png

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 15
(6,495 Views)
Hi TiTou,

Thanks for the advice. I'll try your suggestion and post an update here in due course.

Miika
0 Kudos
Message 5 of 15
(6,477 Views)

Hi TiTou,

 

I implemented what you suggested but I am encountering an error

 

Error 8 occurred at TDMS Open

 

Possible reason(s):

 

Labview: File permission error.  You do not have the correct permissions for the file.

============================================================

NI-488:  DMA hardware error detected.

 

Any idea why this is happening?

 

Miika

0 Kudos
Message 6 of 15
(6,452 Views)

Hmmm... surprising... can you check the file path you give and also connect an "open or create" constant to the open TDMS primitive?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 7 of 15
(6,449 Views)

My file path is just simply to a folder on the desktop.

 

I've selected open or create constant and connected it to TDMS open.  Still won't work.  It's strange - I am the admin on the computer I'm using so I don't see why it has permissions errors. Smiley Sad

0 Kudos
Message 8 of 15
(6,446 Views)

@CP Miika wrote:

My file path is just simply to a folder on the desktop.

 


How do you form the file path? can you show you code please?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 9 of 15
(6,443 Views)

Hi TiTou,

 

I'm using a stacked sequence.  TDMS 1 shows the folder creation and TDMS 2 shows where this path is fed to TDMS open.vi via sequence local.

 

I hope you can help me.

 

 

Download All
0 Kudos
Message 10 of 15
(6,409 Views)