exporting data collector table in between batch processing folders of images
Hello,
I have a batch processing macro set up that can quickly count particles on thousands of images and collect all the measurements into the data collector. Currently, when I am done doing the batch, another macro exports the data into a text file using the run after feature of batch processing. I have several folders that I need to work through for one experiment and right now, I am setting up each folder individually in the batch processing.
I would like to update my workflow so that I am able to expand my image processing runs to include several folders where each folder corresponds to a different sample and has a different folder name. I need to analyze/compare the data between the different samples but I don't want to manually select each folder anymore. Is there a way to export or group the data in the data collector before moving on to a new folder?
Thanks!
I have a batch processing macro set up that can quickly count particles on thousands of images and collect all the measurements into the data collector. Currently, when I am done doing the batch, another macro exports the data into a text file using the run after feature of batch processing. I have several folders that I need to work through for one experiment and right now, I am setting up each folder individually in the batch processing.
I would like to update my workflow so that I am able to expand my image processing runs to include several folders where each folder corresponds to a different sample and has a different folder name. I need to analyze/compare the data between the different samples but I don't want to manually select each folder anymore. Is there a way to export or group the data in the data collector before moving on to a new folder?
Thanks!
0
Answers
-
Hi misbrit2128,
The batch processing can handle multiple folders, if they are sub-folders of the main folder, when you activate "Include subfolders" option. Then you just need to compare the folder of the active image and collected folder (that can be set to a global variable) before collecting the data and save the data into a text file and clear data collector when folder is about to change. You can get the file name of the active documant using FineName property:Private gCollectedFolder As String="" 'global variable, clean it up in RunBefore sub Public Sub CheckImageFolder Dim DocFileName As String=ThisApplication.ActiveDocument.FileName Debug.Print $"File name of the image = {DocFileName}" Dim DocFolder As String=System.IO.Path.GetDirectoryName(DocFileName) Debug.Print $"Folder name of the image = {DocFolder}" If DocFolder<>gCollectedFolder Then If gCollectedFolder<>"" Then Dim subFolderName As String=DocFolder.Replace(System.IO.Directory.GetParent(gCollectedFolder).FullName,"").Replace("\","") 'todo: '1. Save Data Collector data to a file with subFolderName name
'2. Clear Data Collector Debug.Print $"Data Saved to file {subFolderName}" End If gCollectedFolder=DocFolder End If 'collect data End Sub
Yuri0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions