Macro editing - help needed
I’m trying to analyse percentage staining of tissue for a drug trial. I’m blinded as to what groups each same has been assigned to, so it’s really important that I can keep track of the file names.
What I’m trying to do is (always) subtract the background light image from the active image before then applying filter ranges, counting and exporting to excel
I’m using the macro wizard but I’m having a problem. When it subtracts the background it creates a new image, and renames this filename_BGSubtracted, but then when I try to batch process using this macro it renames every new image file as filename_BGSubtracted (whatever the original image I used to record the macro). This means that when it exports the data to excel everything is named the same and I can’t keep track of my samples.
What I need is its original filename with BGSubtracted added to it.
The relevant bit of my macro code is below – I’m guessing I need to change something in the line where is says name, but I don’t know how to phrase it (sorry – I’m a biologist not a coder!)
Any help or suggestions welcomed,
Thankyou, Ceri
Public Function ceri_test() As SimpleScript
ceri_test = New SimpleScript
Dim doc1, image1, doc2
Dim var1 = "background_subtract_tif", doc3, window1, window2
With Application.RibbonCommands.SelectRibbonTab(ceri_test)
.TabName = "Process"
.Run()
End With
With Application.DocumentCommands.Active(ceri_test)
.Run(doc1)
End With
With Adjust.ImageCommands.Duplicate(ceri_test)
.Name = "Pre 020 CHN M Plac PLGF0004_BGSubtracted"
.Visible = True
.Run(doc1, image1)
End With
Answers
-
Hi Ceri,
Just remove the line
.Name = "Pre 020 CHN M Plac PLGF0004_BGSubtracted"
from your macro, so the image will use the original name and not the fixed one.
Yuri
0 -
Thankyou so much
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions