this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null))); this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null)));
    public void copy(IObject model, ModelMapper mapper) {    	if (model instanceof Image) {			Image i = (Image) model;            super.copy(model,mapper);                        // Details            if (i.getDetails() != null){                Details d = i.getDetails();                this.setCreated(mapper.event2timestamp(d.getCreationEvent()));                this.setInserted(mapper.event2timestamp(d.getUpdateEvent()));//TODO                this.setOwner((ExperimenterData) mapper.findTarget(d.getOwner()));                if ( d.getCounts() != null )                {                    Object annotationCount = d.getCounts().get( Image.ANNOTATIONS );                    if ( annotationCount instanceof Integer )                        this.setAnnotationCount( (Integer) annotationCount  );                                        Object classificationCount = d.getCounts().get( Image.CATEGORYLINKS );                    if ( classificationCount instanceof Integer )                        this.setClassificationCount( (Integer) classificationCount  );                                    }            }            // Fields            this.setName(i.getName());            this.setDescription(i.getDescription());			this.setDefaultPixels((PixelsData)mapper.findTarget(i.getDefaultPixels()));			this.setAllPixels((Set) mapper.findCollection(i.collectFromPixels(null)));			this.setAnnotations((Set) mapper.findCollection(i.collectFromAnnotations(null)));                        // Collections            MapperBlock block = new MapperBlock( mapper );            setDatasets( new HashSet( i.collectFromDatasetLinks( block )));            		} else {			throw new IllegalArgumentException("ImageData copies only from Image");		}    }