Macro to save snapshot/ outline files based image name after performing particle measurements
Hello Image-Pro Plus programmers: I just recently started to use Image-Pro Plus (version 7) to perform particle analysis on images captured using light microscopy. My goal is to write a macro that reads images from a folder (perhaps up to 100+ images/ folder), perform pre-filtering (e.g. HiPass), threshold, measure 10+ parameters for each particle in the image, save a snapshot of the particle outlines/ numbers, save the outlines file (.scl), record the particle measurements in the Data Recorder, and finally export the measurement data to a text file for analysis in R. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
I have used the macro recorder, Data Collector and the Batch Process plug-in to get most of the way there (see code below). The issue that I have is how to write a for loop (or other coding method) that saves the snapshot image and outlines file as the image name including the addition of “_outlines” to the name: e.g. Image1_outlines.scl and Image1_outlines.tif. Note the image names are more complex; I simplified them for the example.
Note the lines for saving the image/ outline files are hard-coded to save only a single name, not one that assigns a name that is based on the actual image/ file name.
ret = IpSCalSelect("10x_0.3NA_LU_
ret = IpFltHiPass(3, 10, 1) ‘ applies an initial hi-pass filter to image
ret = IpBlbCount() ‘performs particle size/ count measurements
ret = IpBlbUpdate(0) ‘
ret = IpDcSet(DC_AUTO, 0) ‘Data Collector
ret = IpDcUpdate(DC_FETCH) ’collects data using Data Collector
ret = IpBlbSaveOutline("C:\Documents And Settings\jhietpas\Desktop\
ret = IpSnap() ‘snaps an image of the particle outlines/ numbers
ret = IpWsSaveAs("C:\Documents And Settings\jhietpas\Desktop \Images\Processed\
ret = IpDocClose() ‘ closes the image after analysis
Thanks very much for any information/ help you can provide,