public Content readContent(final BufferedReader in) throws IOException { String name = null; String line; boolean foundNext = false; while ((line = in.readLine()) != null) { if (line.startsWith("BeginContent")) { foundNext = true; break; } } if (!foundNext) return null; while ((line = in.readLine()) != null) { if (line.startsWith("name")) { name = line.split("=")[1].trim(); break; } } final TreeMap<Integer, ContentInstant> cis = new TreeMap<Integer, ContentInstant>(); ContentInstant ci = null; while ((ci = readContentInstant(in)) != null) cis.put(ci.timepoint, ci); if (name == null) throw new RuntimeException("no name for content"); return new Content(name, cis); }
public static Content createContent(final CustomMultiMesh node, final String name, final int tp) { final Content c = new Content(name, tp); final ContentInstant content = c.getInstant(tp); content.color = null; content.transparency = 0f; content.shaded = true; content .showCoordinateSystem(UniverseSettings.showLocalCoordinateSystemsByDefault); content.display(node); return c; }
private void makeSpotContent() { blobs = new TreeMap<>(); contentAllFrames = new TreeMap< >(); final double radiusRatio = ( Double ) displaySettings.get( KEY_SPOT_RADIUS_RATIO ); final SpotCollection spots = model.getSpots(); @SuppressWarnings( "unchecked" ) final FeatureColorGenerator< Spot > spotColorGenerator = ( FeatureColorGenerator< Spot > ) displaySettings.get( KEY_SPOT_COLORING ); for ( final int frame : spots.keySet() ) { if ( spots.getNSpots( frame, false ) == 0 ) { continue; // Do not create content for empty frames } buildFrameContent( spots, frame, radiusRatio, spotColorGenerator ); } spotContent = new Content( SPOT_CONTENT_NAME, contentAllFrames ); spotContent.showCoordinateSystem( false ); universe.removeContent( SPOT_CONTENT_NAME ); universe.addContentLater( spotContent ); }
private Content makeTrackContent() { // Prepare tracks instant trackNode = new TrackDisplayNode( model ); universe.addTimelapseListener( trackNode ); // Pass tracks instant to all instants final TreeMap< Integer, ContentInstant > instants = new TreeMap< >(); final ContentInstant trackCI = new ContentInstant( "Tracks_all_frames" ); trackCI.display( trackNode ); instants.put( 0, trackCI ); final Content tc = new Content( TRACK_CONTENT_NAME, instants ); tc.setShowAllTimepoints( true ); tc.showCoordinateSystem( false ); return tc; }
private Content makeTrackContent() { // Prepare tracks instant trackNode = new TrackDisplayNode( model ); universe.addTimelapseListener( trackNode ); // Pass tracks instant to all instants final TreeMap< Integer, ContentInstant > instants = new TreeMap< >(); final ContentInstant trackCI = new ContentInstant( "Tracks_all_frames" ); trackCI.display( trackNode ); instants.put( 0, trackCI ); final Content tc = new Content( TRACK_CONTENT_NAME, instants ); tc.setShowAllTimepoints( true ); tc.showCoordinateSystem( false ); return tc; }
private void makeSpotContent() { blobs = new TreeMap<>(); contentAllFrames = new TreeMap< >(); final double radiusRatio = ( Double ) displaySettings.get( KEY_SPOT_RADIUS_RATIO ); final SpotCollection spots = model.getSpots(); @SuppressWarnings( "unchecked" ) final FeatureColorGenerator< Spot > spotColorGenerator = ( FeatureColorGenerator< Spot > ) displaySettings.get( KEY_SPOT_COLORING ); for ( final int frame : spots.keySet() ) { if ( spots.getNSpots( frame, false ) == 0 ) { continue; // Do not create content for empty frames } buildFrameContent( spots, frame, radiusRatio, spotColorGenerator ); } spotContent = new Content( SPOT_CONTENT_NAME, contentAllFrames ); spotContent.showCoordinateSystem( false ); universe.removeContent( SPOT_CONTENT_NAME ); universe.addContentLater( spotContent ); }
public static Content createContent(final String name, final ImagePlus[] images, final int type, final int resf, int tp, final Color3f color, final int thresh, final boolean[] channels) { final TreeMap<Integer, ContentInstant> instants = new TreeMap<Integer, ContentInstant>(); final boolean timelapse = images.length > 1; final boolean shouldSwap = SWAP_TIMELAPSE_DATA && timelapse; for (final ImagePlus imp : images) { final ContentInstant content = new ContentInstant(name); content.image = imp; content.color = color; content.threshold = thresh; content.channels = channels; content.resamplingF = resf; content.timepoint = tp; content .showCoordinateSystem(UniverseSettings.showLocalCoordinateSystemsByDefault); content.displayAs(type); content.compile(); if (shouldSwap) { content.clearOriginalData(); content.swapDisplayedData(); } instants.put(tp++, content); } return new Content(name, instants, shouldSwap); }
public static Content createContent(final CustomMesh mesh, final String name, final int tp) { final Content c = new Content(name, tp); final ContentInstant content = c.getInstant(tp); content.color = mesh.getColor(); content.transparency = mesh.getTransparency(); content.shaded = mesh.isShaded(); content .showCoordinateSystem(UniverseSettings.showLocalCoordinateSystemsByDefault); content.display(new CustomMeshNode(mesh)); return c; }
final TreeMap< Integer, ContentInstant > instants = new TreeMap< >(); instants.put( 0, ci ); final Content c = new Content( "instants", instants );
content = new Content("VoCal Network"); content.setUserData(vasculature); content.display(contentNode);