OOF2: The Manual
Name
OOF.Image.AutoGroup — Create a pixel group for each color in the image.
Synopsis
OOF.Image.AutoGroup(image, name_template)
Description
If a Microstructure is being built from an Image which has a one-to-one
correspondence between pixel color and Material, then the most
convenient way to assign Materials to pixels is to automatically
create a PixelGroup for each color, and then to assign Materials to
the pixels in each pixel group. The AutoGroup
command performs the first part of this process, creating pixel
groups for each color of pixel in the given Image.
The name_template parameter specifies how the
names for the automatically created groups will be generated. It
should be a string containing either %c or
%n or both. When naming a group,
%c will be replaced by the color of the
pixels in the group, and %n will be replaced
by an integer. The colors are written in the slightly uncomfortable
but compact form #RRGGBB, where
RR, GG, and
BB are the hexadecimal values of the 8-bit
RGB color channels. It may be advisable to manually rename the groups.
This command operates on all pixels in the Image, not just the
active
ones.
![]() |
Caution |
|---|---|
|
This command does not work well on noisy experimental micrographs, because pixels whose colors differ only due to noise will be put into different groups. It also doesn't work well on artifical micrographs produced by drawing programs, if the programs use antialiasing to smooth lines and boundaries. Even if an antialiased image appears to contain only a few colors, it will generally have many slightly different colors at the borders between regions, and AutoGroup will create a large number of small groups. Better ways of creating pixel groups from noisy or antialiased images are
|


![[Caution]](IMAGES/caution.png)

