Number of frames and McImageSetLocationsClass
Hello
I'm using the code below to perform an EDF on a 3D timelapse image. The code is not tested yet because although its basically the recorded code from the Record Macro option I get the following error "Type identifier is invalid referring to the line below.
.SetFrames = New System.Collections.Generic.List(Of MediaCy.IQL.Sets.McImageSetLocations)
Also which command do you use to get the number of z and number of timepoints in an image
Full code below
Public Function MergeRed() Dim x As Integer Dim doc1, image1, doc2, image2, doc3 With Application.DocumentCommands.Active(MergeRed) .Run(ThisApplication.ActiveImage) End With With Process.FramesCommands.Extract(MergeRed) .SetFrames = New System.Collections.Generic.List(Of MediaCy.IQL.Sets.McImageSetLocations) Dim locations As MediaCy.IQL.Sets.McImageSetLocationsClass For x = 0 To 5 locations = New MediaCy.IQL.Sets.McImageSetLocationsClass locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdChannel, 1) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdZ, x) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdScan, 0) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdSite, 0) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdTime, 0) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdResolution, 0) locations.Add(MediaCy.IQL.Sets.mcImageSetDimensions.mcisdUser2, 0) .SetFrames.Add(locations) Next x .ViewClassName = "McGalleryView" .FrameByFrame = False .BestFocusPlane = False .NormalizeIllumination = False .BottomUp = False .Prefilter = MediaCy.IQL.Align.mcefPreFilterType.mcpftVarDilation3x3 .VarianceThreshold = 50 .Run(doc1, image1) End With
End Function
0
Best Answer
-
Hi David,Low level set operations are not covered by commands, so you have to use IQL functions to get all these parameters. Below is a sample macro that prints all dimensions of the active set from the active location:
Public Sub GetSetDimentions() If ThisApplication.ActiveDocument Is Nothing Then Exit Sub Dim imSet As McImageSet=ThisApplication.ActiveDocument.GetData(GetType(McImageSet),Nothing) If imSet IsNot Nothing Then Dim lc As McImageSetLocations=imSet.GetCurrentLocation For Each ilc As McImageSetLocation In lc Dim length As Integer=imSet.GetDimensionLength(ilc.Dimension,lc) If length>1 Then Debug.Print (ilc.Dimension.ToString() & " = " & length) End If Next End If End Sub
For other set operations you have to check IQL functions in MediaCy.IQL.Sets namespace of the automation help.Yuri0
Answers
Hello Yuri
The references worked, but which commands would you use to find how many timepoints and how many z are in an image.
Regards
David
Hello Yuri
Thanks for code to extract the max projections over time it works well. I'm now trying to extend it to work on 2 or 3 colour images but using the debugger its very difficult to figure out what the various variables contain and therefore what they are doing so that I can modify the correct bit. In the debugger each variable seems to hold a hex memory location rather than readable values. I've been using the .DisplayName you suggested in a previous post but this doesn't work on most of the variables is there another way to figure out what the variables are doing. I've searched the help files for the commands but I'm struggling a bit with them
Regards
David
Hello Yuri
Got it, you select the channel then run your code
Regards
David