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; }
channels.add( new Channel( c, channelNameList.get( c ) ) ); 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 );
protected String[] assembleChannels( final List< Channel > channels ) { final String[] chs = new String[ channels.size() ]; for ( int t = 0; t < chs.length; ++t ) chs[ t ] = channels.get( t ).getName(); return chs; }
newChannelId = Math.max( vs.getChannel().getId(), newChannelId ); newAngleId = Math.max( vs.getAngle().getId(), newAngleId ); newIllumId = Math.max( vs.getIllumination().getId(), newIllumId ); new ViewSetup( newViewSetupId++, c.getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ), new ViewSetup( newViewSetupId++, channels.get( c ).getName() + "_" + illums.get( i ).getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ), new FinalVoxelDimensions( "px", Util.getArrayFromValue( downsampling, 3 ) ), new Tile( newTileId ), new Channel( newChannelId ), new Angle( newAngleId ), new Illumination( newIllumId ) ) );
public static ArrayList< ViewDescription > getAllViewIdsForChannelSorted( final SpimData data, final Collection< ? extends ViewId > viewIds, final Channel channel ) { final ArrayList< ViewDescription > views = new ArrayList< ViewDescription >(); for ( final ViewId id : viewIds ) { final ViewDescription vd = data.getSequenceDescription().getViewDescription( id ); if ( vd.isPresent() && vd.getViewSetup().getChannel().getId() == channel.getId() ) views.add( vd ); } Collections.sort( views ); return views; }
new ViewSetup( newViewSetupId++, c.getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", new double[] { downsampling, downsampling, downsampling * anisoF } ), new ViewSetup( newViewSetupId++, channels.get( c ).getName() + "_" + illums.get( i ).getName(), fusion.getDownsampledBoundingBox(), new FinalVoxelDimensions( "px", new double[] { downsampling, downsampling, downsampling * anisoF } ), new FinalVoxelDimensions( "px", new double[] { downsampling, downsampling, downsampling * anisoF } ), new Tile( 0 ), new Channel( 0 ), new Angle( 0 ), new Illumination( 0 ) ) );
@Override public int compare( final ViewId o1, final ViewId o2 ) { final int id1 = sd.getViewDescriptions().get( o1 ).getViewSetup().getAttribute( Channel.class ).getId(); final int id2 = sd.getViewDescriptions().get( o2 ).getViewSetup().getAttribute( Channel.class ).getId(); return id1 - id2; } } );
" 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 )
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; }
channelList.add( new Channel( c, channelNameList.get( c ) ) ); 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 ArrayList< ViewDescription > getAllViewIdsForChannelTimePointSorted( final SpimData data, final Collection< ? extends ViewId > viewIds, final Channel channel, final TimePoint timePoint ) { final ArrayList< ViewDescription > views = new ArrayList< ViewDescription >(); for ( final ViewId id : viewIds ) { final ViewDescription vd = data.getSequenceDescription().getViewDescription( id ); if ( vd.isPresent() && vd.getViewSetup().getChannel().getId() == channel.getId() && id.getTimePointId() == timePoint.getId() ) views.add( vd ); } Collections.sort( views ); return views; }
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; } /*
public static ArrayList< ViewSetup > createViewSetups( final int[] rotations, final int rotationAxis, final Interval range ) channels.add( new Channel( 0, "Channel1" ) );
private static String createSetupName( final BasicViewSetup setup ) { if ( setup.hasName() ) return setup.getName(); String name = ""; final Angle angle = setup.getAttribute( Angle.class ); if ( angle != null ) name += ( name.isEmpty() ? "" : " " ) + "a " + angle.getName(); final Channel channel = setup.getAttribute( Channel.class ); if ( channel != null ) name += ( name.isEmpty() ? "" : " " ) + "c " + channel.getName(); return name; }
e = new Channel( 0 ); viewSetup.setAttribute( e );