def create_state(image, pos, rad, slab=None, sigma=<NUM_LIT>, conf=conf_simple):
<EOL>if not hasattr(rad, '<STR_LIT>'):<EOL><INDENT>rad = rad*np.ones(pos.shape[<NUM_LIT:0>])<EOL><DEDENT>model = models.models[conf.get('<STR_LIT>')]()<EOL>components = []<EOL>for k,v in iteritems(conf.get('<STR_LIT>', {})):<EOL><INDENT>args = conf.get('<STR_LIT:args>').get(k, {})<EOL>comp = model.registry[k][v](**args)<EOL>components.append(comp)<EOL><DEDENT>sphs = objs.PlatonicSpheresCollection(pos, rad)<EOL>if slab is not None:<EOL><INDENT>sphs = ComponentCollection([sphs, objs.Slab(zpos=slab+pad)], category='<STR_LIT>')<EOL><DEDENT>components.append(sphs)<EOL>s = states.ImageState(image, components, sigma=sigma)<EOL>if isinstance(image, util.NullImage):<EOL><INDENT>s.model_to_data()<EOL><DEDENT>return s<EOL>
Create a state from a blank image, set of pos and radii

Parameters:
-----------
image : `peri.util.Image` object
    raw confocal image with which to compare.

pos : initial conditions for positions (in raw image coordinates)
rad : initial conditions for radii array (can be scalar)
sigma : float, noise level

slab : float
    z-position of the microscope slide in the image (pixel units)