public static ArrayList< ViewSetup > createViewSetupsFromImgLoader(SimulatedBeadsImgLoader2 imgLoader) { final ArrayList< ViewSetup > viewSetups = new ArrayList< ViewSetup >(); SimulateBeads2 sb = imgLoader.getSimulateBeads(); int vid = 0; for (int a : new ArrayList<>(sb.angleTransforms.keySet()).stream().sorted().collect( Collectors.toList() )) for (int channel : new ArrayList<>(sb.channelTransforms.keySet()).stream().sorted().collect( Collectors.toList() )) for (int illum : new ArrayList<>(sb.illumTransforms.keySet()).stream().sorted().collect( Collectors.toList() )) for (int tile : new ArrayList<>(sb.tileTransforms.keySet()).stream().sorted().collect( Collectors.toList() )) { final VoxelDimensions voxelSize = new FinalVoxelDimensions( "pixels", 1, 1, 1 ); final Dimensions dim = imgLoader.getSimulateBeads().getImg( 0, a, channel, tile, illum ); viewSetups.add( new ViewSetup( vid++, Integer.toString( vid ), dim, voxelSize, new Tile(tile), new Channel(channel), new Angle(a), new Illumination(illum) ) ); } return viewSetups; }
illuminations.add( new Illumination( i, illuminationsNameList.get( i ) ) ); 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 );
newChannelId = Math.max( vs.getChannel().getId(), newChannelId ); newAngleId = Math.max( vs.getAngle().getId(), newAngleId ); newIllumId = Math.max( vs.getIllumination().getId(), newIllumId ); c, new Angle( newAngleId ), new Illumination( newIllumId ) ) ); new ViewSetup( newViewSetupId++, channels.get( c ).getName() + "_" + illums.get( i ).getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ), new Channel( newChannelId ), new Angle( newAngleId ), new Illumination( newIllumId ) ) );
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; }
c, new Angle( 0 ), new Illumination( 0 ) ) ); new ViewSetup( newViewSetupId++, channels.get( c ).getName() + "_" + illums.get( i ).getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", new double[] { downsampling, downsampling, downsampling * anisoF } ), new Channel( 0 ), new Angle( 0 ), new Illumination( 0 ) ) );
" angle=" + a.getName() + " ch=" + c.getName() + " illum=" + i.getName() + " tp=" + t.getName() + " type=" + meta.pixelTypeString() + " img=" + img.getClass().getSimpleName() + "<" + type.getClass().getSimpleName() + ">]" ); int ch = i.getId() * meta.numChannels() + c.getId(); // i0( c0, c1, c2 ), i1( c0, c1, c2 )
/** * 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; }
protected ArrayList< ViewSetup > createViewSetups( final DHMMetaData meta ) { final ArrayList< Channel > channels = new ArrayList< Channel >(); channels.add( new Channel( meta.getAmpChannelId(), meta.getAmplitudeDir() ) ); channels.add( new Channel( meta.getPhaseChannelId(), meta.getPhaseDir() ) ); final ArrayList< Illumination > illuminations = new ArrayList< Illumination >(); illuminations.add( new Illumination( 0, String.valueOf( 0 ) ) ); final ArrayList< Angle > angles = new ArrayList< Angle >(); angles.add( new Angle( 0, String.valueOf( 0 ) ) ); final ArrayList< ViewSetup > viewSetups = new ArrayList< ViewSetup >(); for ( final Channel c : channels ) for ( final Illumination i : illuminations ) for ( final Angle a : angles ) { final VoxelDimensions voxelSize = new FinalVoxelDimensions( meta.calUnit, meta.calX, meta.calY, meta.calZ ); final Dimensions dim = new FinalDimensions( new long[]{ meta.getWidth(), meta.getHeight(), meta.getDepth() } ); viewSetups.add( new ViewSetup( viewSetups.size(), null, dim, voxelSize, c, a, i ) ); } return viewSetups; }
illuminationList.add( new Illumination( i, illuminationsNameList.get( i ) ) ); 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 ) );
@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 ); }
protected String[] assembleIllums( final List< Illumination > illums ) { final String[] is = new String[ illums.size() ]; for ( int t = 0; t < is.length; ++t ) is[ t ] = illums.get( t ).getName(); return is; }
illuminations.add( new Illumination( 0, "Illum1" ) );
final Illumination illumination = new Illumination( conf.illuminations[ illuminationIndex ] ); illumination.getId() == viewDataBeads.getIllumination() && channel.getId() == viewDataBeads.getChannel() )
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; }
public String dialogName() { String s = ""; s += ( ts.size() > 1 ) ? "all_timepoints" : "timepoint_" + ts.iterator().next().getName(); s += ( cs.size() > 1 ) ? "_all_channels" : "_channel_" + cs.iterator().next().getName(); s += ( is.size() > 1 ) ? "_all_illuminations" : "_illumination_" + is.iterator().next().getName(); s += ( as.size() > 1 ) ? "_all_angles" : "_angle_" + as.iterator().next().getName(); return s; } /*
e = new Illumination( 0 ); viewSetup.setAttribute( e );
illums.add( data.getSequenceDescription().getViewDescription( viewId ).getViewSetup().getIllumination().getId() );
public static void main( String args[] ) { new ImageJ(); IOFunctions.printIJLog = true; final LoadParseQueryXML lpq = new LoadParseQueryXML(); final ArrayList< String > queryFor = new ArrayList< String >(); queryFor.add( "Timepoint" ); queryFor.add( "channel" ); queryFor.add( "angle" ); queryFor.add( "Tile" ); queryFor.add( "illumination" ); lpq.queryXML( true, true, true, true, true ); for ( final TimePoint i : lpq.getTimePointsToProcess() ) System.out.println( i.getId() ); for ( final ViewSetup v : lpq.getViewSetupsToProcess() ) { System.out.println( v.getId() + " " + v.getAngle().getName() + " " + v.getChannel().getName() + " " + v.getIllumination().getName() ); } } }