public static TimePoints createTimepoints() { final ArrayList< TimePoint > timepointList = new ArrayList< TimePoint >(); timepointList.add( new TimePoint( 0 ) ); return new TimePoints( timepointList ); }
/** * Split the sequence represented in <code>aggregator</code> into * partitions. * * @param aggregator * represents the full dataset. * @param timepointsPerPartition * how many timepoints should each partition contain (if this is * ≤0, put do not split timepoints across partitions). * @param setupsPerPartition * how many setups should each partition contain (if this is * ≤0, put do not split setups across partitions). * @param xmlFilename * path to the xml file to which the sequence will be saved. This * is used to generate paths for the partitions. * @return list of partitions. */ public static ArrayList< Partition > split( final SetupAggregator aggregator, final int timepointsPerPartition, final int setupsPerPartition, final String xmlFilename ) { final String basename = xmlFilename.endsWith( ".xml" ) ? xmlFilename.substring( 0, xmlFilename.length() - 4 ) : xmlFilename; return Partition.split( aggregator.timepoints.getTimePointsOrdered(), aggregator.setups, timepointsPerPartition, setupsPerPartition, basename ); }
protected static String[] assembleTimepoints( final TimePoints timepoints ) { final String[] tps = new String[ timepoints.size() ]; for ( int t = 0; t < tps.length; ++t ) tps[ t ] = timepoints.getTimePointsOrdered().get( t ).getName(); return tps; }
public static boolean setReferenceTimepoint( final TimePoints timepoints, final int referenceTimePoint ) { final TimePoint ref = timepoints.getTimePoints().get( referenceTimePoint ); if ( ref != null ) { final List< TimePoint > tps = timepoints.getTimePointsOrdered(); for ( int tp = 0; tp < tps.size(); ++tp ) { if ( tps.get( tp ).getId() == referenceTimePoint ) { Interest_Point_Registration.defaultReferenceTimepointIndex = tp; return true; } } } return false; }
newMipmapInfos.putAll( mipmapInfos ); final List< TimePoint > tpsOrdered = seq.getTimePoints().getTimePointsOrdered(); final int oldFirst = tpsOrdered.get( 0 ).getId(); final int newFirst = Math.max( maxUsedTimepointId + 1, oldFirst ); tps.put( tpReassigned.getId(), tpReassigned ); final TimePoints newTps = new TimePoints( tps );
final Map< Integer, TimePoint > tps = seq.getTimePoints().getTimePoints(); aggregateTpIds.putAll( tps ); TimePoints aggregateTimepoints = new TimePoints( aggregateTpIds ); for ( final SpimDataMinimal spimData : spimDatas ) final Map< Integer, TimePoint > tps = seq.getTimePoints().getTimePoints(); if ( aggregateTpIds.keySet().equals( tps.keySet() ) ) aggregateTimepoints = seq.getTimePoints(); for ( final BasicViewSetup setup : aggregateSetups.values() ) for ( final TimePoint timepoint : aggregateTimepoints.getTimePointsOrdered() )
++countMissingViews; final int timepoints = data.getSequenceDescription().getTimePoints().size();
protected File getFile( final ViewId view ) { final TimePoint tp = sequenceDescription.getTimePoints().getTimePoints().get( view.getTimePointId() ); final BasicViewSetup vs = sequenceDescription.getViewSetups().get( view.getViewSetupId() ); final String timepoint = tp.getName(); final String angle = vs.getAttribute( Angle.class ).getName(); final String channel = vs.getAttribute( Channel.class ).getName(); final String illum = vs.getAttribute( Illumination.class ).getName(); final String tile = vs.getAttribute( Tile.class ).getName(); final String[] fileName = StackList.getFileNamesFor( fileNamePattern, replaceTimepoints, replaceChannels, replaceIlluminations, replaceAngles, replaceTiles, timepoint, channel, illum, angle, tile, numDigitsTimepoints, numDigitsChannels, numDigitsIlluminations, numDigitsAngles, numDigitsTiles ); // check which of them exists and return it for ( final String fn : fileName ) { final File f = new File( path, fn ); if ( f.exists() ) return f; else IOFunctions.println( "File '" + f.getAbsolutePath() + "' does not exist." ); } IOFunctions.println( "Could not find file for tp=" + timepoint + ", angle=" + angle + ", channel=" + channel + ", ill=" + illum + ", tile=" + tile ); return null; }
final SequenceDescriptionMinimal seq = new SequenceDescriptionMinimal( new TimePoints( timepointMap ), setupMap, null, null ); @SuppressWarnings( { "rawtypes", "unchecked" } ) // TODO: when ij2 supports java 7, replace SuppressWarnings by new ImarisImageLoader<>(...) final ImarisImageLoader<?,?,?> imgLoader = new ImarisImageLoader( dataType, new File( fn ), mipmapInfo, dimensions, seq ); 0, sy, 0, 0, 0, 0, sz, 0 ); for ( final TimePoint timepoint : seq.getTimePoints().getTimePointsOrdered() )
final int maxTimePointIndex = sequenceDescription.getTimePoints().size() - 1; spinnerMinTimepoint.setModel( new SpinnerNumberModel( 0, 0, maxTimePointIndex, 1 ) ); timepointsPanel.add( spinnerMinTimepoint );
protected boolean queryDetails() { // all attibutes this.attributeInstancesToProcess = new HashMap< String, List< Entity > >(); for ( int attributeIndex = 0; attributeIndex < this.attributes.size(); ++attributeIndex ) this.attributeInstancesToProcess.put( this.attributes.get( attributeIndex ), new ArrayList< Entity >() ); for ( int i = 0; i < this.attributes.size(); ++i ) { final String attribute = this.attributes.get( i ); final int choice = attributeChoice.containsKey( attribute ) ? attributeChoice.get( attribute ) : 0; if ( !query( choice, attribute, this.allAttributeInstances.get( attribute ), this.attributeInstancesToProcess.get( attribute ) ) ) return false; } // timepoints this.timepointsToProcess = new ArrayList< TimePoint >(); final String attribute = XmlKeys.TIMEPOINTS_TIMEPOINT_TAG; final int choice = attributeChoice.containsKey( attribute ) ? attributeChoice.get( attribute ) : 0; if ( !query( choice, attribute, this.data.getSequenceDescription().getTimePoints().getTimePointsOrdered(), this.timepointsToProcess ) ) return false; return true; }
protected static TimePoints createTimePoints( final SPIMConfiguration conf ) { final ArrayList< TimePoint > timepoints = new ArrayList<>(); for ( final int tp : conf.timepoints ) timepoints.add( new TimePoint( tp ) ); return new TimePoints( timepoints ); }
final List< TimePoint > sequenceTimepointsOrdered = sequenceDescription.getTimePoints().getTimePointsOrdered(); final SequenceDescriptionMinimal seq = new SequenceDescriptionMinimal( new TimePoints( timepointsToCrop ), cropSetups, cropper, null );
public static BigDataViewer open( final AbstractSpimData< ? > spimData, final String windowTitle, final ProgressWriter progressWriter, final ViewerOptions options ) { if ( WrapBasicImgLoader.wrapImgLoaderIfNecessary( spimData ) ) { System.err.println( "WARNING:\nOpening <SpimData> dataset that is not suited for interactive browsing.\nConsider resaving as HDF5 for better performance." ); } final ArrayList< ConverterSetup > converterSetups = new ArrayList<>(); final ArrayList< SourceAndConverter< ? > > sources = new ArrayList<>(); initSetups( spimData, converterSetups, sources ); final AbstractSequenceDescription< ?, ?, ? > seq = spimData.getSequenceDescription(); final int numTimepoints = seq.getTimePoints().size(); final CacheControl cache = ( ( ViewerImgLoader ) seq.getImgLoader() ).getCacheControl(); final BigDataViewer bdv = new BigDataViewer( converterSetups, sources, spimData, numTimepoints, cache, windowTitle, progressWriter, options ); WrapBasicImgLoader.removeWrapperIfPresent( spimData ); bdv.viewerFrame.setVisible( true ); InitializeViewerState.initTransform( bdv.viewer ); return bdv; }
public static ArrayList< Partition > getPartitions( final AbstractSpimData< ? > spimData, final Parameters params ) { final AbstractSequenceDescription< ?, ?, ? > seq = spimData.getSequenceDescription(); if ( params.split ) { final String xmlFilename = params.seqFile.getAbsolutePath(); final String basename = xmlFilename.endsWith( ".xml" ) ? xmlFilename.substring( 0, xmlFilename.length() - 4 ) : xmlFilename; List< TimePoint > timepoints = seq.getTimePoints().getTimePointsOrdered(); List< ? extends BasicViewSetup > setups = seq.getViewSetupsOrdered(); return Partition.split( timepoints, setups, params.timepointsPerPartition, params.setupsPerPartition, basename ); } else return null; }
public static TimePoints createTimePointsFromImgLoader(SimulatedBeadsImgLoader2 imgLoader) { final ArrayList< TimePoint > timepointList = new ArrayList< TimePoint >(); SimulateBeads2 sb = imgLoader.getSimulateBeads(); for (int tp : new ArrayList<>(sb.tpTransforms.keySet()).stream().sorted().collect( Collectors.toList() )) timepointList.add( new TimePoint( tp ) ); return new TimePoints( timepointList ); }
final int numTimepoints = seq.getTimePoints().size(); final VolatileGlobalCellCache cache = ( VolatileGlobalCellCache ) ( ( ViewerImgLoader ) seq.getImgLoader() ).getCacheControl(); handle.getBdvHandle().getCacheControls().addCacheControl( cache );
public static int getBDVTimePointIndex(final TimePoint t, final AbstractSpimData< ? > data) { final List< TimePoint > list = data.getSequenceDescription().getTimePoints().getTimePointsOrdered(); for ( int i = 0; i < list.size(); ++i ) if ( list.get( i ).getId() == t.getId() ) return i; return 0; }
protected TimePoints createTimePoints( final LightSheetZ1MetaData meta ) { final ArrayList< TimePoint > timepoints = new ArrayList< TimePoint >(); for ( int t = 0; t < meta.numTimepoints(); ++t ) timepoints.add( new TimePoint( t ) ); return new TimePoints( timepoints ); }
final int nAllTimepoints = data.getSequenceDescription().getTimePoints().size();