t.setLocation( locations.get( new ViewSetupPrecursor( c.getId(), i.getId(), a.getId(), t.getId() ) ) ); final Calibration cal = calibrations.get( new ViewSetupPrecursor( c.getId(), i.getId(), a.getId(), t.getId() ) ); final VoxelDimensions voxelSize = new FinalVoxelDimensions( cal.calUnit, cal.calX, cal.calY, cal.calZ );
for ( final Tile x : tileList ) final Calibration cal = calibrations.get( new ViewSetupPrecursor( c.getId(), i.getId(), a.getId(), x.getId(), channelNameList, illuminationsNameList, angleNameList, tileNameList ) ); final VoxelDimensions voxelSize = new FinalVoxelDimensions( cal.calUnit, cal.calX, cal.calY, cal.calZ ); viewSetups.add( new ViewSetup( viewSetups.size(), null, null, voxelSize, x, c, a, i ) );
public static ViewSetup getViewSetup( final List< ? extends ViewSetup > list, final Channel c, final Angle a, final Illumination i, final Tile x ) { for ( final ViewSetup viewSetup : list ) { if ( viewSetup.getAngle().getId() == a.getId() && viewSetup.getChannel().getId() == c.getId() && viewSetup.getIllumination().getId() == i.getId() && viewSetup.getTile().getId() == x.getId() ) { return viewSetup; } } return null; }
/** * find ViewSetup index corresponding to given (angle, illumination, * channel) triple. * * @return setup index or -1 if no corresponding setup was found. */ protected static int getViewSetupId( final ArrayList< ViewSetup > setups, final int angle, final int illumination, final int channel ) { for ( final ViewSetup s : setups ) if ( s.getAngle().getId() == angle && s.getIllumination().getId() == illumination && s.getChannel().getId() == channel ) return s.getId(); return -1; }
@Override public ImgPlus< UnsignedShortType > getImage( final int timepointId, final ImgLoaderHint... hints ) { ensureExpIsOpen(); final int channel = setup.getChannel().getId(); final int illumination = setup.getIllumination().getId(); final int angle = setup.getAngle().getId(); final ImagePlus imp = getImagePlus( timepointId ); final Img< UnsignedShortType > img = ImageJFunctions.wrapShort( imp ); final String name = getBasename( timepointId, angle, channel, illumination ); final AxisType[] axes = new AxisType[] { Axes.X, Axes.Y, Axes.Z }; final float zStretching = ( float ) ( exp.pd / exp.pw ); final double[] calibration = new double[] { 1, 1, zStretching }; return new ImgPlus<>( img, name, axes, calibration ); }
public static String getTitle( final int splittingType, final Group< ViewDescription > group ) { String title; final ViewDescription vd0 = group.iterator().next(); if ( splittingType == 0 ) // "Each timepoint & channel" title = "fused_tp_" + vd0.getTimePointId() + "_ch_" + vd0.getViewSetup().getChannel().getId(); else if ( splittingType == 1 ) // "Each timepoint, channel & illumination" title = "fused_tp_" + vd0.getTimePointId() + "_ch_" + vd0.getViewSetup().getChannel().getId() + "_illum_" + vd0.getViewSetup().getIllumination().getId(); else if ( splittingType == 2 ) // "All views together" title = "fused"; else // "All views" title = "fused_tp_" + vd0.getTimePointId() + "_vs_" + vd0.getViewSetupId(); return title; }
illums.add( data.getSequenceDescription().getViewDescription( viewId ).getViewSetup().getIllumination().getId() );
illumination.getId() == viewDataBeads.getIllumination() && channel.getId() == viewDataBeads.getChannel() )
vd.getViewSetup().getAngle().getId() + " channelId: " + vd.getViewSetup().getChannel().getId() + " illumId: " + vd.getViewSetup().getIllumination().getId() + ". Continuing with next one." ); e.printStackTrace();
private ImagePlus getImagePlus( final int timepointId ) { final int channel = setup.getChannel().getId(); final int illumination = setup.getIllumination().getId(); final int angle = setup.getAngle().getId(); final int s = exp.sampleStart; final int r = exp.regionStart; final int f = exp.frameStart; final int zMin = exp.planeStart; final int zMax = exp.planeEnd; final int xMin = 0; final int xMax = exp.w - 1; final int yMin = 0; final int yMax = exp.h - 1; ImagePlus imp; if ( hasAlternatingIllumination ) { final int zStep = 2; if ( illumination == 0 ) imp = exp.openNotProjected( s, timepointId, timepointId, r, angle, channel, zMin, zMax - 1, zStep, f, f, yMin, yMax, xMin, xMax, SPIMExperiment.X, SPIMExperiment.Y, SPIMExperiment.Z, false ); else imp = exp.openNotProjected( s, timepointId, timepointId, r, angle, channel, zMin + 1, zMax, zStep, f, f, yMin, yMax, xMin, xMax, SPIMExperiment.X, SPIMExperiment.Y, SPIMExperiment.Z, false ); } else { imp = exp.openNotProjected( s, timepointId, timepointId, r, angle, channel, zMin, zMax, f, f, yMin, yMax, xMin, xMax, SPIMExperiment.X, SPIMExperiment.Y, SPIMExperiment.Z, false ); } return imp; } }
illums.add( data.getSequenceDescription().getViewDescription( viewId ).getViewSetup().getIllumination().getId() );
+ vd.getViewSetup().getAngle().getId() + " channelId: " + vd.getViewSetup().getChannel().getId() + " illumId: " + vd.getViewSetup().getIllumination().getId() + ". Continuing with next one." ); e.printStackTrace();
vdS.getViewSetup().getTile().getId() == vdT.getViewSetup().getTile().getId() && vdS.getViewSetup().getAngle().getId() == vdT.getViewSetup().getAngle().getId() && vdS.getViewSetup().getIllumination().getId() == vdT.getViewSetup().getIllumination().getId() && vdS.getTimePointId() == vdT.getTimePointId() )
final int a = vd.getViewSetup().getAttribute( Angle.class ).getId(); final int c = vd.getViewSetup().getAttribute( Channel.class ).getId(); final int i = vd.getViewSetup().getAttribute( Illumination.class ).getId();
int ch = i.getId() * meta.numChannels() + c.getId(); // i0( c0, c1, c2 ), i1( c0, c1, c2 )
newChannelId = Math.max( vs.getChannel().getId(), newChannelId ); newAngleId = Math.max( vs.getAngle().getId(), newAngleId ); newIllumId = Math.max( vs.getIllumination().getId(), newIllumId );
+ vd.getViewSetup().getAngle().getId() + " channelId: " + vd.getViewSetup().getChannel().getId() + " illumId: " + vd.getViewSetup().getIllumination().getId() + ". Continuing with next one." ); e.printStackTrace();