Automating Partial stacks in Zerene Stacker
Moderators: rjlittlefield, ChrisR, Chris S., Pau
Automating Partial stacks in Zerene Stacker
The batch processing utility in Zerene Stacker can really make it easy to edit deep stacks, but creating the batch file can be a lot work. See the Zerene Stacker tutorials at http://www.zerenesystems.com/cms/stacke ... howtouseit for more information on batch processing.
I've written a little C# command line application to generate the xml files that are consumed by Zerene Stacker's batch utility. It can create batch files that will do partial (incremental) stacks as well as stacks suitable for movies. See http://www.photomacrography.net/forum/v ... php?t=9320 for an example of the movie mode)
There is a readme.txt file in the zip file, that has detailed information on how to run the application. Download the zip file to your computer, unzip to a folder, and execute the program (specifying the necessary parameters).
The zip file is located at http://myplace.frontier.com/~edward.fre ... S_0712.zip Running the application may require .NET 3.5 to be installed. I have only used this on Windows 7, so can't guarantee that it will work on any other OS.
Enjoy
I've written a little C# command line application to generate the xml files that are consumed by Zerene Stacker's batch utility. It can create batch files that will do partial (incremental) stacks as well as stacks suitable for movies. See http://www.photomacrography.net/forum/v ... php?t=9320 for an example of the movie mode)
There is a readme.txt file in the zip file, that has detailed information on how to run the application. Download the zip file to your computer, unzip to a folder, and execute the program (specifying the necessary parameters).
The zip file is located at http://myplace.frontier.com/~edward.fre ... S_0712.zip Running the application may require .NET 3.5 to be installed. I have only used this on Windows 7, so can't guarantee that it will work on any other OS.
Enjoy
Wow, Ed, thanks! Excellent.
I could use a film like that to show people what it is we gain from focus stacking. Your film does this, but I'd like to have one that matches one of my subjects, taken at a higher magnification. Now, to put it on the list of things to get around to. . . .
Thanks for sharing!
--Chris
I could use a film like that to show people what it is we gain from focus stacking. Your film does this, but I'd like to have one that matches one of my subjects, taken at a higher magnification. Now, to put it on the list of things to get around to. . . .
Thanks for sharing!
--Chris
This looks really useful! I just did my first manual substack stack and it makes quite the difference... so big thank you Elf!
Just checking if I'm doing this right
Unzip etc
use DOS window, fill params 1 by 1, start by giving it a name?
(I'm a little unclear on these please, what do they mean?)
then call this xml from inside zerene
close zerene, reopen, stack substacks using dmap
That's it, condensed?
Thank you very much
update: I have discovered exe.config, makes things much easier. But still a bit unclear what some of these params are.
Just checking if I'm doing this right
Unzip etc
use DOS window, fill params 1 by 1, start by giving it a name?
(I'm a little unclear on these please, what do they mean?)
Code: Select all
-SelectedStackOverlap
Amount of overlap in Selected Stack
-AllImageStackType
0: Don't create an All Image stack
1: PMAX only
2: DMAP only
3: PMAX and DMAP
4: Align All
close zerene, reopen, stack substacks using dmap
That's it, condensed?
Thank you very much
update: I have discovered exe.config, makes things much easier. But still a bit unclear what some of these params are.
My extreme-macro.co.uk site, a learning site. Your comments and input there would be gratefully appreciated.
ok, specific question.
I've filled in exe.config, but I cannot for the life of me get the xml file generated. Can someone give me noddy foolproof instructions please what I should be doing - @"ZereneVS in dos in the right directory returns me a message "Number of command line parameters = 0" but doesn't generate an xml out of the info I put into exe.config.
Help?!
Thank you
I've filled in exe.config, but I cannot for the life of me get the xml file generated. Can someone give me noddy foolproof instructions please what I should be doing - @"ZereneVS in dos in the right directory returns me a message "Number of command line parameters = 0" but doesn't generate an xml out of the info I put into exe.config.
Help?!
Thank you
My extreme-macro.co.uk site, a learning site. Your comments and input there would be gratefully appreciated.
The commandline shoud be something like this:
ZereneVS.exe -SourceImageFolder <path to images> -SourceImageFileMask jpg -OutputType 1 -SelectedStackImageCount 7 -SelectedStackType 4 -SelectedStackOverlap 2 -AllImageStackType 0
The above assumes you're using jpegs and want PMax stacks. Individual stacks will contain seven images with the first two images and last two images also contained in the previous and next stack.
There is a little bug in ZereneVS.exe. It sets the OutputImagesDesignatedFolder value to <source image folder>\Automation\zOut but creates a folder named <source image folder>\Automation\zsOut. Renaming the folder to zOut cures the problem.
ZereneVS.exe -SourceImageFolder <path to images> -SourceImageFileMask jpg -OutputType 1 -SelectedStackImageCount 7 -SelectedStackType 4 -SelectedStackOverlap 2 -AllImageStackType 0
The above assumes you're using jpegs and want PMax stacks. Individual stacks will contain seven images with the first two images and last two images also contained in the previous and next stack.
There is a little bug in ZereneVS.exe. It sets the OutputImagesDesignatedFolder value to <source image folder>\Automation\zOut but creates a folder named <source image folder>\Automation\zsOut. Renaming the folder to zOut cures the problem.
Many thanks for sharing this; exceptionally useful!
I have a quick query. With 62 input images I used the following commands to create partial stacks ('slabs'):
-SelectedStackImageCount 10
-SelectedStackOverlap 4
After the batch completed I end up with 10 partial stacks in the zOut subfolder. How was the number of partial stacks determined by the script and is it possible to identify which images went into each partial stack?
Thanks for your help (and thanks again for a very useful piece of work!).
Best wishes,
Des
I have a quick query. With 62 input images I used the following commands to create partial stacks ('slabs'):
-SelectedStackImageCount 10
-SelectedStackOverlap 4
After the batch completed I end up with 10 partial stacks in the zOut subfolder. How was the number of partial stacks determined by the script and is it possible to identify which images went into each partial stack?
Thanks for your help (and thanks again for a very useful piece of work!).
Best wishes,
Des
- rjlittlefield
- Site Admin
- Posts: 23603
- Joined: Tue Aug 01, 2006 8:34 am
- Location: Richland, Washington State, USA
- Contact:
Zerene's batch scripts are human-readable XML. You can open them with any text editor, and the tag names should be suggestive enough to figure out what's going on. In this case, look for SelectedInputIndices followed by a list of SelectedInputIndex values. The index values start numbering at 0 within the list of input files.
0-9 (first slab: 10 images)
6-15 (second slab: 10 images, 4 shared with first slab)
12-21 (third slab: 10 images, 4 shared with second slab)
18-27 etc.
24-33
32-41
38-47
44-53
50-59
56-61 (tenth slab: all the remaining images, sharing 4 images with ninth slab)
If you'd like to have the slab outputs named to include bits of the file names, then consider changing the output image naming template as described at http://zerenesystems.com/cms/stacker/do ... tput_names.
--Rik
From the parameters you've listed, I imagine that the stacks will consist of selected indices as follows:With 62 input images I used the following commands to create partial stacks ('slabs'):
-SelectedStackImageCount 10
-SelectedStackOverlap 4
0-9 (first slab: 10 images)
6-15 (second slab: 10 images, 4 shared with first slab)
12-21 (third slab: 10 images, 4 shared with second slab)
18-27 etc.
24-33
32-41
38-47
44-53
50-59
56-61 (tenth slab: all the remaining images, sharing 4 images with ninth slab)
If you'd like to have the slab outputs named to include bits of the file names, then consider changing the output image naming template as described at http://zerenesystems.com/cms/stacker/do ... tput_names.
--Rik
Rik has it exactly right
You can set the output naming template by adding the parameter to the ZereneVS command line.
Example:
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"
Note: When a Zerene Stacker parameter has a '.', just delete the '.' to create the ZereneVS parameter.
You can set the output naming template by adding the parameter to the ZereneVS command line.
Example:
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"
Note: When a Zerene Stacker parameter has a '.', just delete the '.' to create the ZereneVS parameter.
Rik, Humans come in many types. A sheet of Rachmaninov music is also human readable (dots go up= higher pitch: very easy).Zerene's batch scripts are human-readable XML.
I'm struggling all day now with this, and I'm still nowhere. I keep on trying, but for people who hear the word xml for the first time this way of working is extremely complicated.
Just venting some frustration ;-))
Kind regards,
Rollin
edit1: I'm getting somewhere, I have a XML file now that Zerene seems to accept, but nothing happens. This was the command line
ZereneVS.exe
-SourceImageFolder C:\substack\substackfolder\images -ProjectsDesignatedFolder C:\substack\project -OutputImagesDesignatedFolder C:\substack\substackfolder\output -SourceImageFileMask jpg
-OutputType 1
-SelectedStackImageCount 10
-SelectedStackType 4
-SelectedStackOverlap 2
-AllImageStackType 0
-BatchXmlName rollinbatch1.xml
78 images, substacks of 10 images with an overlap of 2.
edit2: For other simple minds like myself: you should run this batch with the images imported in Zerene. Batch>load batch script>rollinbatch1.xml (in this case). Now it seems to work more or less, nothing is opened nor saved automatically. But it worked.
I think the more you use the batch file capabilities, whether you use ZereneVS or the Zerene Stacker batch dialog, the more you'll understand what you need to set for a particular set of images. Zerene Stacker is a pretty complex program and it's amazing Rik was able to expose most of it in the batch xml file format. The first batch file I created was over 11,000 lines long and would have been rather tedious to do manually See http://www.photomacrography.net/forum/v ... ight=movie.
The following additions to your commandline will create PMax and DMap stacks of all images plus PMax slabs and loads the source images:
ZereneVS.exe
-SourceImageFolder C:\substack\substackfolder\images
-ProjectsDesignatedFolder C:\substack\project
-OutputImagesDesignatedFolder C:\substack\substackfolder\output
-SourceImageFileMask jpg
-OutputType 1
-SelectedStackImageCount 10
-SelectedStackType 4
-SelectedStackOverlap 2
-BatchXmlName rollinbatch1.xml
-AllImageStackType 3
-Source C:\substack\substackfolder\images
-OutputImageDispositionCode 3
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"
p.s. The DMap stack will require user input unless you add more parameters to control those settings.
The following additions to your commandline will create PMax and DMap stacks of all images plus PMax slabs and loads the source images:
ZereneVS.exe
-SourceImageFolder C:\substack\substackfolder\images
-ProjectsDesignatedFolder C:\substack\project
-OutputImagesDesignatedFolder C:\substack\substackfolder\output
-SourceImageFileMask jpg
-OutputType 1
-SelectedStackImageCount 10
-SelectedStackType 4
-SelectedStackOverlap 2
-BatchXmlName rollinbatch1.xml
-AllImageStackType 3
-Source C:\substack\substackfolder\images
-OutputImageDispositionCode 3
-OutputImageNamingTemplate "{method} skip={FSF},EstimationRadius={ER},ContrastThresholdPct={CTPCT}"
p.s. The DMap stack will require user input unless you add more parameters to control those settings.
Thank you very much for your help. You know, in our language Elf means Fairy?
I've been thinking why it is so hard to understand for me, but there is a double language barrier. First, I have to cope with English jargon before I can begin with the structure of the XML. Imagine all these words and phrases would be in French or Dutch. That's why lots of things that are easy to understand for Americans are difficult for the rest of us.
I hope Rik will find the time to add this function to Zerene. On the other hand, there must be some challenge left I guess ;-)
Thanks again!
Rollin
- rjlittlefield
- Site Admin
- Posts: 23603
- Joined: Tue Aug 01, 2006 8:34 am
- Location: Richland, Washington State, USA
- Contact: