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

Activate programmaticaly a specific channel/frame on an imageset

A customized automation opens an imageset (.czi image) with 4 channels. After that, the user should deline some regions on the third channel every time. Finally the automation move to the next image.

I tried to record a macro, but I did not find the right mechanism to control the behavior. How can I solve this?

Version: Image-Pro Premier 9.3.3.

Thanks in advance.

Answers

  • Hi fsup,

    You should be able to record such macro just by switching off color composite mode and selecting the channel.
    Here how it looks in my recording, the macro selects the channel 2 image (0-based):

        Public Function ActivateChannel2() As SimpleScript
            ActivateChannel2 = New SimpleScript
            Dim window1
    
            With Application.WindowCommands.Active(ActivateChannel2)
                .Run(window1)
            End With
    
            With View.ImageSetViewCommands.Options(ActivateChannel2)
                .ColorCompositeView = False
                .ActiveRegionInUse = MediaCy.IQL.Sets.mcImageSetActivePortionTypes.mcisaptCurrentLocation
                .ViewLocation = New McImageSetLocations
                .ViewLocation.Add(mcImageSetDimensions.mcisdChannel, 2)
                .Run(window1)
            End With
    
        End Function
    
    
    You can modify it to select any channel.

    Yuri
  • Hi Yuri,

    thank you for your prompt reply.

    The solution works when I extract the Very Large Image (with the extract tool) in a previous step. After that I can activate the channel via macro. But because of the big sized images it takes time.
    Is it possible to do this without any extraction on the original czi image?

    Thanks
    fsup

  • fsup, 

    Do you need the whole image or just some area of it? If you need an area, I recommend to put a ROI around that area (on the original VLI image) and Extract that area  (at the desired resolution). It will be a fast operation, which is also recordable. Then you can use my macro to go to the required channel on the extracted image set.

    Yuri
  • Hi Yuri,

    For further steps I need the whole image.

    Thanks
    fsup
Sign In or Register to comment.