IMcImageSetAddFrame Method |
![]() |
Namespace: MediaCy.IQL.Sets
Sub AddFrame ( Frame As McFrame, Location As McImageSetLocations )
Sub CreateSetFromFrames() Dim aSet As McImageSet ' Note: Sample set file must be loaded, for instance PollenGreen.seq If ThisApplication.ActiveImage Is Nothing Then MsgBox "Please open the PollenGreen.seq image file" Exit Sub End If If ThisApplication.ActiveImage.FrameCount <> 48 Then MsgBox "Please open the PollenGreen.seq image file" Exit Sub End If Set aSet = ImageSets.Add("SampleSet") aSet.Experimenter = "IQ user" aSet.Description = "This is a sample set of 3 pollen grains, taken as follows:" + vbCrLf + " 16 Z positions by" + vbCrLf + " 3 sites (the X/Y location of the grains) by" + vbCrLf + " 4 channels (R, G, B, and color composite)" ' first, this is the "normal" way to add the frames, pretty much in the order they exist in the image Dim theLoc As New McImageSetLocations Dim i As Integer Dim theFrame As McFrame For i = 0 To 15 theLoc.RemoveAll ' get ready for next location theLoc.Add mcisdChannel, 0 ' adding Channel 0 theLoc.Add mcisdZ, i ' and this Z position ' note that while we are adding site 0 in this loop, we don't really have to specify that ' because a position of zero is assumed for any unspecified dimensions Set theFrame = ThisApplication.ActiveImage.Frame(i) aSet.AddFrame theFrame, theLoc Next i ' However, you don't have to add them in this way. The internal structure of the set will be the ' same if you add the frames in any other order that is valid. There are two sites of 16 Z positions ' each left in the image. We'll add them while alternating between the two sites instead Dim lFrame As Long Dim iZ As Integer For iZ = 0 To 15 For i = 1 To 2 ' we already added site zero, above lFrame = i * 16 + iZ ' calculate frame index in the source image theLoc.RemoveAll ' get ready for next position theLoc.Add mcisdChannel, 0 ' we're still adding Channel 0 theLoc.Add mcisdZ, iZ ' and this Z position at theLoc.Add mcisdSite, i ' this site Set theFrame = ThisApplication.ActiveImage.Frame(lFrame) aSet.AddFrame theFrame, theLoc Next i Next iZ End Sub