當前位置: 首頁>>代碼示例>>Java>>正文


Java IOFunctions類代碼示例

本文整理匯總了Java中mpicbg.spim.io.IOFunctions的典型用法代碼示例。如果您正苦於以下問題:Java IOFunctions類的具體用法?Java IOFunctions怎麽用?Java IOFunctions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IOFunctions類屬於mpicbg.spim.io包,在下文中一共展示了IOFunctions類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: removeInconsistentLinks

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
public static void removeInconsistentLinks(
		final Collection< Pair< Group< ViewId >, Group< ViewId > > > removedInconsistentPairs,
		final Map< Pair< Group< ViewId >, Group< ViewId > >, ? > stitchingResults )
{
	for ( final Pair< Group< ViewId >, Group< ViewId > > inconsistentPair : removedInconsistentPairs )
	{
		final Pair< Group< ViewId >, Group< ViewId > > reverseInconsistentPair = TransformationTools.reversePair( inconsistentPair );

		if ( stitchingResults.containsKey( inconsistentPair ) )
			stitchingResults.remove( inconsistentPair );
		else if ( stitchingResults.containsKey( reverseInconsistentPair ) )
			stitchingResults.remove( reverseInconsistentPair );
		else
			IOFunctions.println( "ERROR: Could not remove one of the links that was removed by the global optimization. This is not critical, but shouldn't happen." );
	}
}
 
開發者ID:PreibischLab,項目名稱:BigStitcher,代碼行數:17,代碼來源:GlobalOptStitcher.java

示例2: preSmooth

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected < T extends RealType< T > > void preSmooth( final RandomAccessibleInterval< T > img )
{
	if ( additionalSigmaX > 0.0 || additionalSigmaY > 0.0 || additionalSigmaZ > 0.0 )
	{
		IOFunctions.println( "presmoothing image with sigma=[" + additionalSigmaX + "," + additionalSigmaY + "," + additionalSigmaZ + "]" );
		try
		{
			Gauss3.gauss( new double[]{ additionalSigmaX, additionalSigmaY, additionalSigmaZ }, Views.extendMirrorSingle( img ), img );
		}
		catch (IncompatibleTypeException e)
		{
			IOFunctions.println( "presmoothing failed: " + e );
			e.printStackTrace();
		}
	}
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:17,代碼來源:DifferenceOf.java

示例3: getDetection

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
@Override
public Bead getDetection() 
{
        // this is just a good guess that might speed up a lot
        Bead bead = view.getBeadStructure().getDetection( detectionID );

        // check if it is the bead with the right ID
        if ( bead.getID() != detectionID )
        {
               bead = null;
               for ( final Bead b : view.getBeadStructure().getDetectionList() )
                      if ( bead.getID() == detectionID )
                             bead = b;

               if ( bead == null )
               {
               	IOFunctions.printErr( "BeadIdentification.getBead(): Cannot find a bead for beadID=" + detectionID + " in view=" + view.getID() );
                   return null;
               }
        }
        return bead;
  }
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:23,代碼來源:BeadIdentification.java

示例4: setViewError

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
public void setViewError( final ViewDataBeads otherView, final double error )
{
	boolean foundView = false;
	
	for( ViewErrorPairWise viewError : connectedViews )
	{
		if ( viewError.getView() == otherView )
		{
			viewError.setAvgError( error );
			foundView = true;
		}
	}
	
	if ( !foundView && view.getViewStructure().getDebugLevel() <= ViewStructure.DEBUG_ERRORONLY )
		IOFunctions.println( "ViewErrorStatistics.setViewError(): Warning! " + otherView + " is not part of the structure of my view " + view );
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:17,代碼來源:ViewErrorStatistics.java

示例5: AutomaticAngleSetup

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
public AutomaticAngleSetup( final ViewStructure viewStructure )
{		
	final ArrayList<ViewDataBeads>views = viewStructure.getViews();
	
	final ViewDataBeads viewA = views.get( 0 ); 
	final ViewDataBeads viewB = views.get( 1 );
	
	IOFunctions.println("Using view " + viewA.getName() + " and " + viewB.getName() + " for automatic angle setup." );
	
	final Vector3d rotationAxis = extractRotationAxis( (AffineModel3D)viewA.getTile().getModel(), (AffineModel3D)viewB.getTile().getModel() );
	//final float rotationAngle = extractRotationAngle( viewA.getTile().getModel(), viewB.getTile().getModel(), rotationAxis );
	//IOFunctions.println( "rotation axis: " + rotationAxis + ", angle: " + rotationAngle );
			
	IOFunctions.println( "rotation axis: " + rotationAxis );		
	rotationAxis.normalize();		
	IOFunctions.println( "rotation axis normed: " + rotationAxis );
	final Vector3d xAxis = new Vector3d( new double[] { 1, 0, 0 } );
			
	IOFunctions.println( "Difference to xAxis: " + distance( rotationAxis, xAxis ) );
	//testRotationAxis();
	//getCommonAreaPerpendicularViews( viewA, viewB );
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:23,代碼來源:AutomaticAngleSetup.java

示例6: main

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
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( "illumination" );
	
	lpq.queryXML( 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() );
	}
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:24,代碼來源:LoadParseQueryXML.java

示例7: createUniqueName

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected String createUniqueName()
{
	long idSum = 1;

	for ( final TimePoint t : getTimePointsToProcess() )
		idSum *= t.getId();

	for ( final BasicViewSetup v : getViewSetupsToProcess() )
		idSum += v.getId();

	long nano = System.nanoTime();
	long millis = System.currentTimeMillis();
	long finalHash = nano + millis + idSum;

	if ( debugRandomClusterHash )
	{
		IOFunctions.println( "idsum=" + idSum );
		IOFunctions.println( "nano=" + nano );
		IOFunctions.println( "millis=" + millis );
		IOFunctions.println( "final=" + finalHash );
	}

	return "" + finalHash;
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:25,代碼來源:GenericLoadParseQueryXML.java

示例8: selectImgFactory

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected ImgFactory<? extends NativeType<?>> selectImgFactory(final SlideBook6MetaData meta) {
    int[] dims = meta.imageSize(0);
    long maxNumPixels = dims[0];
    maxNumPixels *= dims[1];
    maxNumPixels *= dims[2];

    String s = "Maximum number of pixels in any view: n=" + Long.toString(maxNumPixels) +
            " px ";

    if (maxNumPixels < Integer.MAX_VALUE) {
        IOFunctions.println(s + "< " + Integer.MAX_VALUE + ", using ArrayImg.");
        return new ArrayImgFactory<FloatType>();
    } else {
        IOFunctions.println(s + ">= " + Integer.MAX_VALUE + ", using CellImg.");
        return new CellImgFactory<FloatType>(256);
    }
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:18,代碼來源:SlideBook6.java

示例9: querySLDFile

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected File querySLDFile() {
    GenericDialogPlus gd = new GenericDialogPlus("Define SlideBook6 diSPIM Dataset");

    gd.addFileField("SlideBook6 SLD file", defaultFilePath, 50);
    gd.showDialog();

    if (gd.wasCanceled())
        return null;

    final File firstFile = new File(defaultFilePath = gd.getNextString());
    if (!firstFile.exists()) {
        IOFunctions.println("File '" + firstFile.getAbsolutePath() + "' does not exist. Stopping");
        return null;
    } else {
        IOFunctions.println("Investigating file '" + firstFile.getAbsolutePath() + "'.");
        return firstFile;
    }
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:19,代碼來源:SlideBook6.java

示例10: finish

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
@Override
public boolean finish()
{
	System.out.println( "finish()" );
	String path = params.getSeqFile().getAbsolutePath();
	try
	{
		new XmlIoSpimData2( "" ).save( spimData, path );

		IOFunctions.println( "(" + new Date( System.currentTimeMillis() ) + "): Saved xml '" + path + "'." );

		// this spimdata object was not modified, we just wrote a new one
		return false;
	}
	catch ( SpimDataException e )
	{
		IOFunctions.println( "(" + new Date( System.currentTimeMillis() ) + "): Could not save xml '" + path + "'." );
		e.printStackTrace();
		return false;
	}
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:22,代碼來源:ExportSpimData2HDF5.java

示例11: getDouble

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected static double getDouble( final Hashtable< String, Object > metadata, final String key )
{
	if ( metadata == null )
		throw new RuntimeException( "Missing metadata while looking for: " + key );

	final Object o = metadata.get( key );

	if ( o == null )
	{
		final StringBuilder builder = new StringBuilder();
		for ( final String candidate : metadata.keySet() )
			builder.append( "\n" + candidate );
		//System.out.println( "Available keys:" + builder );

		IOFunctions.println( "Missing key " + key + " in LZ1 metadata" );
		return Double.NaN;
	}

	return Double.parseDouble( o.toString() );
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:21,代碼來源:LightSheetZ1MetaData.java

示例12: queryMMFile

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
protected File queryMMFile()
{
	GenericDialogPlus gd = new GenericDialogPlus( "Define MicroMananger diSPIM Dataset" );

	gd.addFileField( "MicroManager OME TIFF file", defaultFirstFile, 50 );

	gd.showDialog();

	if ( gd.wasCanceled() )
		return null;

	final File firstFile = new File( defaultFirstFile = gd.getNextString() );

	if ( !firstFile.exists() )
	{
		IOFunctions.println( "File '" + firstFile.getAbsolutePath() + "' does not exist. Stopping" );
		return null;
	}
	else
	{
		IOFunctions.println( "Investigating file '" + firstFile.getAbsolutePath() + "'." );
		return firstFile;
	}
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:25,代碼來源:MicroManager.java

示例13: save

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
@Override
public void save()
{
	for ( final Pair< InterestPointList, ViewId > list : panel.delete )
	{
		IOFunctions.println( "Deleting correspondences and interestpoints in timepointid=" + list.getB().getTimePointId() + ", viewid=" + list.getB().getViewSetupId() );

		final File ip = new File( list.getA().getBaseDir(), list.getA().getFile().toString() + list.getA().getInterestPointsExt() );
		final File corr = new File( list.getA().getBaseDir(), list.getA().getFile().toString() + list.getA().getCorrespondencesExt() );

		if ( ip.delete() )
			IOFunctions.println( "Deleted: " + ip.getAbsolutePath() );
		else
			IOFunctions.println( "FAILED to delete: " + ip.getAbsolutePath() );

		if ( corr.delete() )
			IOFunctions.println( "Deleted: " + corr.getAbsolutePath() );
		else
			IOFunctions.println( "FAILED to delete: " + corr.getAbsolutePath() );
	}

	//panel.save.clear();
	panel.delete.clear();
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:25,代碼來源:InterestPointExplorer.java

示例14: EntropyFast

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
public EntropyFast( ViewDataBeads view, ContainerFactory entropyContainerFactory )
{
	super( view );

	// compute window size in z direction
	final int windowSizeZ = Math.round( conf.windowSizeX/(float)view.getZStretching() );
	
	// precompute the entropy for the whole image
	if ( debugLevel <= ViewStructure.DEBUG_MAIN )
		IOFunctions.println("(" + new Date(System.currentTimeMillis()) + "): Computing entropy for " + view + " using a "+conf.windowSizeX+"x"+conf.windowSizeY+"x"+windowSizeZ+" window");
	
	entropy = Entropy.computeEntropy( view.getImage(), entropyContainerFactory, conf.histogramBins, conf.windowSizeX, conf.windowSizeY, windowSizeZ );		
       
	// compute entropy = 100^entropy
	final Cursor<FloatType> i = entropy.createCursor();
	
	while ( i.hasNext() )
	{
		i.fwd();
		i.getType().set( (float)(Math.pow(100, i.getType().get())) );
	}
	
	i.close();
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:25,代碼來源:EntropyFast.java

示例15: actionPerformed

import mpicbg.spim.io.IOFunctions; //導入依賴的package包/類
@Override
public void actionPerformed( final ActionEvent e )
{
	if ( panel == null )
	{
		IOFunctions.println( "Panel not set for " + this.getClass().getSimpleName() );
		return;
	}

	if ( !SpimData2.class.isInstance( panel.getSpimData() ) )
	{
		IOFunctions.println( "Only supported for SpimData2 objects: " + this.getClass().getSimpleName() );
		return;
	}

	new Thread( new Runnable()
	{
		@Override
		public void run()
		{
			if ( new Interest_Point_Detection().detectInterestPoints( (SpimData2)panel.getSpimData(), panel.selectedRowsViewId() ) )
				panel.updateContent(); // update interestpoint panel if available
		}
	}).start();
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:26,代碼來源:DetectInterestPointsPopup.java


注:本文中的mpicbg.spim.io.IOFunctions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。