Home Image-Pro Automation (Macros, Apps, Reports)

Automated classification, Data Collection

Dear Forum,

I'm trying to automate classifications of masks, but can't seem to get it to work. 

I have images with three different color channels. I use smart segmentation for my blue channel, then use those masks for 'learn classification' based on green and red signals within these masks. This works well for one image and I basically get numbers for how many of my blue masks have green, or red in them.
The image files are split by individual channel (i.e. 3 channels = 3 separate files). However, opening them via 'opening images as a sequence' opens the 'plate view'. This means opening one image file opens all associated channels and position on that plate.

I think there are different ways of solving this, but I always get stuck at some point:
1: Data Collector is able to collect data from the whole plate (by 'collect all frames'), but somehow only saves data from my (blue) smart segmentation mask. Is it possible to collect my 'learning classification' , which further classes them into different groups.
2: If the images were separate, instead of the plate format, I could run a batch process to collect data for every image. Is there a way to batch open all channels of one image at once, and then move on to the next position in the plate?
3: Generally, if I open 'Images as a sequence' , the 3 channels have to be made into a 'composite' before I can use Smart Segmentation on it. This seems to complicate batch analysing the images.

Please excuse the long question. I hope this makes sense.

Thanks for your help! 
Henri

Answers

  • Hi Henri,

    If you want to open images separately, you should switch off "Group related files" option in the File Open dialog. 

    "Collect All Frames" works only on sequences, processing every frame as single image, so it may not work for you when you need data from different channels.

    If you have multi-well, multi-channel image set, then there are several ways to process it:

    1. There is "Loop on Set Locations" option in the Batch processing dialog that is designed for that, here is info from the Help:
    • Loop On Set Locations: When processing an image set, run the "Loop On" macro on all set locations but for all channels together. The View.ImageSetViewCommands.Options command can be used to navigate from one channel to another by only assigning the location in the channel dimension.
            With View.ImageSetViewCommands.Options(NewMacro9)
                .ViewLocation.Add(mcImageSetDimensions.mcisdChannel, 0)
                .Run(window1)
            End With
    

    2. There are also special apps (e.g. Image Set Analyzer) that can automate image processing using recorded macros.

    If you can share some sample images (e.g. 2 wells x 3 channels) I can try to demonstrate how it can be done.

    Regards,

    Yuri

  • Thanks Yuri,

    I feel like I have to enable 'group related files', because I'm using the mask from blue, and use it for classification in red and green. However, I was surprised to see that you can only do 'counts' on multichannel images after creating a composite of them.

    Is there a way of 'collecting' the data from my 'learning classification'? It seems to default back to the groups I set up in my smart segmentation.


    I've attached some example images. Thanks so much for having a look.

    Henri
  • edited March 2020
    Hi Henri,

    I've created macros to process your image set with Image Set Analyzer app. I've attached both apps.
    You have to load both apps (attached) ImageSetAnalyzer.ipx and RedGreenClassification.ipx to ImagePro, then  load your image set (with "Group Related Files" option On), set the macros for batch processing as on my screenshot and click the Run button. The result will look like this:


    The LoopOnGR macro does processing of single well:

    1. It creates a composite image of a well.
    2. Segments Blue objects using RedGreenClassification.iqo 
    3. Classifies the objects to Red/Green using 
    RedGreen.lcl (learning classification)
    4. Collects data to DC (with 
    RedGreenDC.adoxsd).

    Note, that you can modify (load, adjust parameters, save) parameters of the segmentation or classification. 

    Let me know if you need more info.

    Regards,

    Yuri

  • Thanks a lot, Yuri. This works really well.

    I'm just trying to wrap my head around how it works. I think one of my problems before was that I saved measurement options as .isb and not .iqo. Not sure what the exact difference is?!
    Also, when I'm creating a composite of the plate, it gives me only 1 composite image with as many 'sequences' as there are positions. In this case it creates 1 composite image with 4 sequences. I think this made subsequent analysis impossible. I can see that your script manages to get one composite image per well, but I can't quite figure out how?!

    Cheers
    Henri 
  • Hi Henri,

    I'm glad it works.

    The Image Set Analyzer extracts one well into a different Image Set (with only one frame per channel), the same as clicking the Extract Current Location button. Then the measurement macro (LoopOnRG) is executed on that small set, so no sequences are involved running the LoopOn macro. The loop then goes through all wells.

    Yuri
Sign In or Register to comment.