ome.model.ImageDimension imageD = (ome.model.ImageDimension) getModel(); PixelsDimensionsTrans pdtransform = new PixelsDimensionsTrans(this, imageD);
PixelsDimensionsTrans pdtransform = new PixelsDimensionsTrans(this, oldPixels.getImage().getImageDimensions().iterator().next());
    public List transmute()    {        ome.model.ImagePixel oldPixels = (ome.model.ImagePixel) getModel();                List toSave = getToSave();        Event creationEvent = getCreationEvent();               // Transform the pixels set metadata        Pixels p = new Pixels();        p.setCreationEvent(creationEvent);        p.setSha1(oldPixels.getFileSha1());        p.setSizeX(oldPixels.getSizeX());        p.setSizeY(oldPixels.getSizeY());        p.setSizeZ(oldPixels.getSizeZ());        p.setSizeC(oldPixels.getSizeC());        p.setSizeT(oldPixels.getSizeT());        p.setBigEndian(false);  // FIXME: This really shouldn't be here        p.setOwner(getOwner());                // Transform the pixels set info        PixelsTypeTrans ptransform = new PixelsTypeTrans(this, oldPixels);        toSave = ptransform.transmute();        PixelsType pixelsType = (PixelsType) toSave.get(toSave.size() - 1);        p.setPixelsType(pixelsType);                // The pixels type doesn't actually need to be saved, as it is an        // internal OMERO3 enumeration, so remove it from the list.        toSave.remove(pixelsType);                // Now transform all channel components of the given pixels set        Set channelComponents = oldPixels.getChannelComponents();        Set channelList = new HashSet();                for (Object o : channelComponents)        {            ome.model.ChannelComponent c = (ome.model.ChannelComponent) o;            ChannelTrans ctransform = new ChannelTrans(this, c);            ctransform.setIndex(c.getIndex());            toSave = ctransform.transmute();            channelList.add(toSave.get(toSave.size() - 1));        }                // Add the channels to the pixels set        p.setChannels(channelList);                // Build an acquisiton context from the logical channel        ome.model.LogicalChannel lc = getFirstLogicalChannel();                AcquisitionContext ac = null;        if (lc != null)        {            AcquisitionContextTrans actransform =                new AcquisitionContextTrans(this, lc);            toSave = actransform.transmute();            ac = (AcquisitionContext) toSave.get(toSave.size() - 1);        }        else            ac = new AcquisitionContext();            toSave.add(ac);                    // Add the acquistion context to the pixels set        p.setAcquisitionContext(ac);                    // Transform the PixelsDimensions and add them to the save list                ome.model.ImageDimension imageD = (ome.model.ImageDimension) getModel();        PixelsDimensionsTrans pdtransform = new PixelsDimensionsTrans(this, imageD);        toSave = pdtransform.transmute();        PixelsDimensions pixelsDimensions = (PixelsDimensions) toSave.get(toSave.size() - 1);        p.setPixelsDimensions(pixelsDimensions);                // Finish up by adding this object to the toSave list and returning        toSave.add(p);        return toSave;    }