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

Merge Open Images

Hello

I'm trying to merge Leica FRAP files once they have been opened. This can be achieved manually but its usual to have a lot of experiments in each .lif file which can result in up to 50 open images. I've figured out that the MergeFrames command is part of MediaCy.Commands.Sequence (I think) but I can't figure out how to assign the images I want to merge to this command set so that it can merge the images. 

Any help appreciated,

Regards

David

Answers

  • Dave, you select the images in the Image Strip, which supports various kinds of multiple selection.
  • Hi David,

    You could merge frames from different sources in the Gallery view (Edit mode).

    Nikita.

  • Hello John

    I'd found the Image Strip method but the student often saves an entire afternoons worth of imaging in 1 file so there are hundreds of them sometimes and it takes ages manually so I was hoping to speed the process up a bit using a script.

    Regards

    Dave

  • Hello David,

    If you want to use scripting, then you can use Process.SequenceCommands.MergeFrames:
    It takes a list of windows as input parameter:
            With Process.SequenceCommands.MergeFrames(MergeTest)
                .Run(New List({window1,window2,window3}), image1)
            End With
    

    Below is the recorded macro that merges 3 images selected in ImageStrip:

        Public Function MergeTest() As SimpleScript
            MergeTest = New SimpleScript
            Dim window1
            Dim var1 = 1, window2
            Dim var2 = 2, window3, image1
    
            With Application.WindowCommands.Active(MergeTest)
                .Run(window1)
            End With
    
            With Application.Window.SelectionCommands.Add(MergeTest)
                .Run(window1)
            End With
    
            With Application.WindowCommands.Define(MergeTest)
                .Run(var1, window2)
            End With
    
            With Application.Window.SelectionCommands.Add(MergeTest)
                .Run(window2)
            End With
    
            With Application.WindowCommands.Define(MergeTest)
                .Run(var2, window3)
            End With
    
            With Application.Window.SelectionCommands.Add(MergeTest)
                .Run(window3)
            End With
    
            With Application.RibbonCommands.SelectRibbonTab(MergeTest)
                .TabName = "Process"
                .Run()
            End With
    
            With Process.SequenceCommands.MergeFrames(MergeTest)
                .Run(New List({window1,window2,window3}), image1)
            End With
    
        End Function
    

    Regards,

    Yuri
Sign In or Register to comment.