当前位置: 首页>>代码示例>>Java>>正文


Java SpimDataMinimal类代码示例

本文整理汇总了Java中bdv.spimdata.SpimDataMinimal的典型用法代码示例。如果您正苦于以下问题:Java SpimDataMinimal类的具体用法?Java SpimDataMinimal怎么用?Java SpimDataMinimal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SpimDataMinimal类属于bdv.spimdata包,在下文中一共展示了SpimDataMinimal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
@SuppressWarnings( "unchecked" )
@Override
public SpimDataMinimal[] load()
{
	SpimDataMinimal spimData = null;
	try
	{
		spimData = new XmlIoSpimDataMinimal().load( xmlPath );

		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." );
		}

	}
	catch ( final SpimDataException e )
	{
		e.printStackTrace();
	}

	return new SpimDataMinimal[]{ spimData };
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:23,代码来源:XMLLoader.java

示例2: CellHandler

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public CellHandler( final String baseUrl, final String xmlFilename, final String datasetName, final String thumbnailsDirectory ) throws SpimDataException, IOException
{
	final XmlIoSpimDataMinimal io = new XmlIoSpimDataMinimal();
	final SpimDataMinimal spimData = io.load( xmlFilename );
	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final Hdf5ImageLoader imgLoader = ( Hdf5ImageLoader ) seq.getImgLoader();

	cache = imgLoader.getCacheControl();
	loader = imgLoader.getShortArrayLoader();
	cacheHints = new CacheHints( LoadingStrategy.BLOCKING, 0, false );

	// dataSetURL property is used for providing the XML file by replace
	// SequenceDescription>ImageLoader>baseUrl
	this.xmlFilename = xmlFilename;
	baseFilename = xmlFilename.endsWith( ".xml" ) ? xmlFilename.substring( 0, xmlFilename.length() - ".xml".length() ) : xmlFilename;
	dataSetURL = baseUrl;

	datasetXmlString = buildRemoteDatasetXML( io, spimData, baseUrl );
	metadataJson = buildMetadataJsonString( imgLoader, seq );
	settingsXmlString = buildSettingsXML( baseFilename );
	thumbnailFilename = createThumbnail( spimData, baseFilename, datasetName, thumbnailsDirectory );
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer-server,代码行数:23,代码来源:CellHandler.java

示例3: createThumbnail

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
/**
 * Create PNG thumbnail file named "{@code <baseFilename>.png}".
 */
private static String createThumbnail( final SpimDataMinimal spimData, final String baseFilename, final String datasetName, final String thumbnailsDirectory )
{
	final String thumbnailFileName = thumbnailsDirectory + "/" + datasetName + ".png";
	final File thumbnailFile = new File( thumbnailFileName );
	if ( !thumbnailFile.isFile() ) // do not recreate thumbnail if it already exists
	{
		final BufferedImage bi = ThumbnailGenerator.makeThumbnail( spimData, baseFilename, Constants.THUMBNAIL_WIDTH, Constants.THUMBNAIL_HEIGHT );
		try
		{
			ImageIO.write( bi, "png", thumbnailFile );
		}
		catch ( final IOException e )
		{
			LOG.warn( "Could not create thumbnail png for dataset \"" + baseFilename + "\"" );
			LOG.warn( e.getMessage() );
		}
	}
	return thumbnailFileName;
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer-server,代码行数:23,代码来源:CellHandler.java

示例4: exec

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public void exec( final String xmlHDF5Path, final int setupID, final String tgmmPath, final String outputPath, final boolean doCrop, final RealInterval interval, final int tFrom, final int tTo )
{
	SpimDataMinimal spimData;
	try
	{
		spimData = new XmlIoSpimDataMinimal().load( xmlHDF5Path );
	}
	catch ( final SpimDataException e )
	{
		logger.error( "Problem reading the transforms in image data file:\n" + e.getMessage() + "\n" );
		return;
	}
	final Model model = createModel( new File( tgmmPath ), spimData, setupID, interval, tFrom, tTo );
	model.setLogger( logger );
	final Settings settings = createSettings( new File( xmlHDF5Path ) );

	final TrackMate trackmate = new TrackMate( model, settings );
	trackmate.setNumThreads( 1 );
	trackmate.computeSpotFeatures( true );
	trackmate.computeEdgeFeatures( true );
	trackmate.computeTrackFeatures( true );

	save( outputPath, model, settings );
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:25,代码来源:ImportTGMMAnnotationPlugin_.java

示例5: run

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
@Override
public void run( final String ignored )
{
	final File imageFile = askForImageFile();
	if ( null == imageFile ) { return; }

	final File tgmmFolder = askForTGMMFolder();
	if ( null == tgmmFolder ) { return; }

	SpimDataMinimal spimData;
	try
	{
		spimData = new XmlIoSpimDataMinimal().load( imageFile.getAbsolutePath() );
	}
	catch ( final SpimDataException e )
	{
		logger.error( "Problem reading the transforms in image data file:\n" + e.getMessage() + "\n" );
		return;
	}
	final String[] angles = readSetupNames( spimData.getSequenceDescription() );
	final int angleIndex = askForAngle( angles );
	if ( angleIndex < 0 ) { return; }

	final int setupID = spimData.getSequenceDescription().getViewSetupsOrdered().get( angleIndex ).getId();
	launchMamut( imageFile, tgmmFolder, setupID, interval );
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:27,代码来源:LoadTGMMAnnotationPlugIn.java

示例6: launchMamut

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public void launchMamut( final File imageFile, final File tgmmFile, final int setupID, final RealInterval interval )
{
	SpimDataMinimal spimData;
	try
	{
		spimData = new XmlIoSpimDataMinimal().load( imageFile.getAbsolutePath() );
	}
	catch ( final SpimDataException e )
	{
		logger.error( "Problem reading the transforms in image data file:\n" + e.getMessage() + "\n" );
		return;
	}
	final Model model = createModel( tgmmFile, spimData, setupID, interval );
	final SourceSettings settings = createSettings();
	new MaMuT( imageFile, model, settings );
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:17,代码来源:LoadTGMMAnnotationPlugIn.java

示例7: createModel

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
protected Model createModel( final File tgmmFolder, final SpimDataMinimal spimData, final int setupID, final RealInterval interval )
{
	final List< AffineTransform3D > transforms = pickTransform( spimData, setupID );

	final TGMMImporter2 importer = new TGMMImporter2( tgmmFolder, transforms, TGMMImporter2.DEFAULT_PATTERN, logger, interval, 0, Integer.MAX_VALUE );
	if ( !importer.checkInput() || !importer.process() )
	{
		logger.error( importer.getErrorMessage() );
		return new Model();
	}
	final Model model = importer.getResult();

	/*
	 * Hack to set the POSITION_T feature of imported spots.
	 */
	final Settings settings = new Settings();
	settings.dt = 1;
	final TrackMate trackmate = new TrackMate( model, settings );
	final ResetSpotTimeFeatureAction action = new ResetSpotTimeFeatureAction();
	action.execute( trackmate );

	return model;
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:24,代码来源:LoadTGMMAnnotationPlugIn.java

示例8: fix

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public static void fix( final String xmlFilename ) throws SpimDataException, IOException
{
	final XmlIoSpimDataMinimal spimDataIo = new XmlIoSpimDataMinimal();
	final SpimDataMinimal spimData = spimDataIo.load( xmlFilename );
	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final Hdf5ImageLoader il = ( Hdf5ImageLoader) seq.getImgLoader();
	final String outfn = il.getHdf5File().getCanonicalPath() + "FIXED";
	final HashMap< Integer, ExportMipmapInfo > perSetupMipmapInfo = new HashMap<>();
	for ( final BasicViewSetup setup : seq.getViewSetupsOrdered() )
	{
		final int setupId = setup.getId();
		final MipmapInfo info = il.getSetupImgLoader( setupId ).getMipmapInfo();
		perSetupMipmapInfo.put( setupId, new ExportMipmapInfo(
				Util.castToInts( info.getResolutions() ),
				info.getSubdivisions() ) );
	}
	final ArrayList< Partition > partitions = il.getPartitions();
	WriteSequenceToHdf5.writeHdf5PartitionLinkFile( seq, perSetupMipmapInfo, partitions, new File( outfn ) );

	System.out.println( "fixed hdf5 master file written to " + outfn );
	System.out.println( "rename it to " + il.getHdf5File().getCanonicalPath() + " to use it." );
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:23,代码来源:FixAbsolutePathsInHdf5Partitions.java

示例9: loadAll

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public SpimDataMinimal[] loadAll( int startid )
{
	SpimDataMinimal[] out = new SpimDataMinimal[ impList.length ];
	index = startid;
	for( int i = 0; i < impList.length; i++ )
	{
		out[ i ] = load( range( index, impList[ i ].getNChannels() ), impList[ i ] );
		index += impList[ i ].getNChannels();
	}
	return out;
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:12,代码来源:ImagePlusLoader.java

示例10: buildRemoteDatasetXML

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
/**
 * Create a modified dataset XML by replacing the ImageLoader with an
 * {@link RemoteImageLoader} pointing to the data we are serving.
 */
private static String buildRemoteDatasetXML( final XmlIoSpimDataMinimal io, final SpimDataMinimal spimData, final String baseUrl ) throws IOException, SpimDataException
{
	final SpimDataMinimal s = new SpimDataMinimal( spimData, new RemoteImageLoader( baseUrl, false ) );
	final Document doc = new Document( io.toXml( s, s.getBasePath() ) );
	final XMLOutputter xout = new XMLOutputter( Format.getPrettyFormat() );
	final StringWriter sw = new StringWriter();
	xout.output( doc, sw );
	return sw.toString();
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer-server,代码行数:14,代码来源:CellHandler.java

示例11: createModel

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
protected Model createModel( final File tgmmFolder, final SpimDataMinimal spimData, final int setupID, final RealInterval interval, final int tFrom, final int tTo )
{

	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final ViewRegistrations regs = spimData.getViewRegistrations();
	final List< AffineTransform3D > transforms = new ArrayList< AffineTransform3D >( seq.getTimePoints().size() );
	for ( final TimePoint t : seq.getTimePoints().getTimePointsOrdered() )
	{
		transforms.add( regs.getViewRegistration( t.getId(), setupID ).getModel() );
	}

	final TGMMImporter2 importer = new TGMMImporter2( tgmmFolder, transforms, TGMMImporter2.DEFAULT_PATTERN, logger, interval, tFrom, tTo );
	if ( !importer.checkInput() || !importer.process() )
	{
		logger.error( importer.getErrorMessage() );
	}
	final Model model = importer.getResult();

	/*
	 * Hack to set the POSITION_T feature of imported spots.
	 */
	final Settings settings = new Settings();
	settings.dt = 1;
	final TrackMate trackmate = new TrackMate( model, settings );
	final ResetSpotTimeFeatureAction action = new ResetSpotTimeFeatureAction();
	action.execute( trackmate );

	return model;
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:30,代码来源:ImportTGMMAnnotationPlugin_.java

示例12: pickTransform

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
protected List< AffineTransform3D > pickTransform( final SpimDataMinimal spimData, final int setupID )
{
	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final ViewRegistrations regs = spimData.getViewRegistrations();
	final List< AffineTransform3D > transforms = new ArrayList< AffineTransform3D >( seq.getTimePoints().size() );
	for ( final TimePoint t : seq.getTimePoints().getTimePointsOrdered() )
	{
		transforms.add( regs.getViewRegistration( t.getId(), setupID ).getModel() );
	}
	return transforms;
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:12,代码来源:LoadTGMMAnnotationPlugIn.java

示例13: openSequence

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
private static SequenceDescriptionMinimal openSequence( final String xmlFilename ) throws SpimDataException
{
	final File f = new File( xmlFilename );
	if ( f.exists() && f.isFile() && f.getName().endsWith( ".xml" ) )
	{
		final SpimDataMinimal spimData = new XmlIoSpimDataMinimal().load( xmlFilename );
		return spimData.getSequenceDescription();
	}
	else
		return null;
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:12,代码来源:ImportPlugIn.java

示例14: writeXmlAndLinks

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public void writeXmlAndLinks() throws SpimDataException
{
	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	WriteSequenceToHdf5.writeHdf5PartitionLinkFile( seq, perSetupMipmapInfo, partitions, hdf5File );
	final Hdf5ImageLoader loader = new Hdf5ImageLoader( hdf5File, partitions, null, false );

	new XmlIoSpimDataMinimal().save( new SpimDataMinimal( spimData, loader ), seqFile.getAbsolutePath() );
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:9,代码来源:Scripting.java

示例15: createSpimData

import bdv.spimdata.SpimDataMinimal; //导入依赖的package包/类
public static final SpimDataMinimal createSpimData( IFormatReader reader )
{
	Hashtable< String, Object > gmeta = reader.getGlobalMetadata();
	System.out.println( gmeta ); // header stuff here TODO
	
	// get relevant metadata
	double pw = 1.0;
	double ph = 1.0;
	double pd = 1.0;

	if( gmeta.keySet().contains( "XResolution" ))
		pw = ((Double)gmeta.get("XResolution")).doubleValue();

	if( gmeta.keySet().contains( "YResolution" ))
		ph = ((Double)gmeta.get("YResolution")).doubleValue();

	if( gmeta.keySet().contains( "Spacing" ))
		pd = ((Double)gmeta.get("Spacing")).doubleValue();

	int numSetups = 1;
	int numTimepoints = 1;
	int[] ids = new int[]{ 349812342 };
	final File basePath = new File( "." );

	String punit = "px";
	if( gmeta.keySet().contains( "Unit" ))
		punit = (String) gmeta.get( "Unit" );
	
	final FinalVoxelDimensions voxelSize = new FinalVoxelDimensions( punit, pw, ph, pd );
	final long w = ((Long)gmeta.get("ImageWidth")).longValue();
	final long h = ((Long)gmeta.get("ImageLength")).longValue();
	final long d = reader.getSizeZ(); //Long.parseLong( (String)gmeta.get("images") );

	long[] dims = new long[]{ w, h, d };
	final FinalDimensions size = new FinalDimensions( new long[] { w, h, d } );

	// create setups from channels
	final HashMap< Integer, BasicViewSetup > setups = new HashMap< Integer, BasicViewSetup >( numSetups );
	for ( int s = 0; s < numSetups; ++s )
	{
		final BasicViewSetup setup = new BasicViewSetup( ids[ s ], String.format( "channel %d", ids[ s ] + 1 ), size, voxelSize );
		setup.setAttribute( new Channel( ids[ s ] + 1 ) );
		setups.put( ids[ s ], setup );
	}

	// create timepoints
	final ArrayList< TimePoint > timepoints = new ArrayList< TimePoint >( numTimepoints );
	for ( int t = 0; t < numTimepoints; ++t )
		timepoints.add( new TimePoint( t ) );

	// create ViewRegistrations from the images calibration
	final AffineTransform3D sourceTransform = new AffineTransform3D();
	sourceTransform.set( 1.0/pw, 0, 0, 0, 0, 1.0/ph, 0, 0, 0, 0, pd, 0 );
	final ArrayList< ViewRegistration > registrations = new ArrayList< ViewRegistration >();
	for ( int t = 0; t < numTimepoints; ++t )
		for ( int s = 0; s < numSetups; ++s )
			registrations.add( new ViewRegistration( t, ids[ s ], sourceTransform ) );

	final SequenceDescriptionMinimal seq = new SequenceDescriptionMinimal( new TimePoints( timepoints ), setups, 
			new DummyImageLoader< FloatType >( new FloatType(), dims ), null );

	SpimDataMinimal spimData = new SpimDataMinimal( basePath, seq, new ViewRegistrations( registrations ) );
	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." );

	return spimData;
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:68,代码来源:BigWarpBatchTransform.java


注:本文中的bdv.spimdata.SpimDataMinimal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。