select channels from opened image

Hi,

I recorded a macro to change display settings of a multichannel ( oib confocal) image. The variable definition in the code looks like that (includes the name of the file and the dye color).

Dim var1 = "Tumor_1_10_CHS1__Hoechst_4e91a61", image1

How can I select the channels in a more generic way from the open doc to define the variable.

Thank you

Answers

  • Hello,

    It's hard to tell from your code snippet but it looks like this name would only be used to control the activation of one document or another, which can certainly be done more generically but we would need the rest of the recording to be able to help.

    Pierre 
  • Here is the code as you can see it defines the variable based on the file and dye name. So if I load another image it does not work.

    So I need the command to say var1 is doc1, channel 1

        Public Function Diplay() As SimpleScript
            Diplay = New SimpleScript
            Dim doc1
            Dim var1 = "Tumor_1_10_CHS1__Hoechst_562cb1", image1
            Dim var2 = "Tumor_1_10_CHS2__Alexa_Fluor__55ac6a", image2
            Dim var3 = "Tumor_1_10_CH3__Cy5", image3
    
            With Application.DocumentCommands.Active(Diplay)
                .Run(doc1)
            End With
    
            With Adjust.ImageCommands.Define(Diplay)
                .Run(var1, image1)
            End With
    
            With Adjust.ColorCompositeCommands.SetDisplay(Diplay)
                .Brightness = 50
                .Contrast = 50
                .Gamma = 1R
                .BLevel = 150R
                .WLevel = 2000R
                .Run(doc1, image1)
            End With
    
            With Adjust.ImageCommands.Define(Diplay)
                .Run(var2, image2)
            End With
    
            With Adjust.ColorCompositeCommands.SetDisplay(Diplay)
                .Brightness = 50
                .Contrast = 50
                .Gamma = 1R
                .BLevel = 150R
                .WLevel = 1500R
                .Run(doc1, image2)
            End With
    
            With Adjust.ImageCommands.Define(Diplay)
                .Run(var3, image3)
            End With
    
            With Adjust.ColorCompositeCommands.SetDisplay(Diplay)
                .Brightness = 50
                .Contrast = 50
                .Gamma = 1R
                .BLevel = 150R
                .WLevel = 500R
                .Run(doc1, image3)
            End With

     

Sign In or Register to comment.