|
1 | 1 | package net.preibisch.fusiontask.task; |
2 | 2 |
|
3 | | -import java.util.ArrayList; |
4 | | -import java.util.List; |
5 | | - |
6 | | -import ij.ImageJ; |
7 | | -import mpicbg.spim.data.SpimDataException; |
8 | | -import mpicbg.spim.data.sequence.ViewId; |
9 | | -import net.imglib2.FinalInterval; |
10 | | -import net.imglib2.Interval; |
11 | | -import net.imglib2.RandomAccessibleInterval; |
12 | | -import net.imglib2.img.display.imagej.ImageJFunctions; |
13 | | -import net.imglib2.type.numeric.real.FloatType; |
14 | | -import net.imglib2.util.Pair; |
15 | | -import net.preibisch.mvrecon.fiji.spimdata.SpimData2; |
16 | | -import net.preibisch.mvrecon.fiji.spimdata.XmlIoSpimData2; |
17 | | -import net.preibisch.mvrecon.process.fusion.FusionTools; |
18 | | -import net.preibisch.simulation.imgloader.SimulatedBeadsImgLoader; |
19 | | - |
20 | 3 | public class Fusion { |
21 | 4 |
|
22 | | - public class FusionParameters |
23 | | - { |
24 | | - // imput: spimdata (xml) |
25 | | - // which views (list of viewid, which is two integers - timepointid, setupid) |
26 | | - // bounding box (which part to process) |
27 | | - // downsampling |
28 | | - // ... |
29 | | - |
30 | | - } |
31 | | - |
32 | | - |
33 | | - public static void main( String[] args ) throws SpimDataException |
34 | | - { |
35 | | - // imput: spimdata (xml) |
36 | | - // which views (list of viewid, which is two integers - timepointid, setupid) |
37 | | - // bounding box (which part to process) |
38 | | - // downsampling |
39 | | - // ... |
40 | | - |
41 | | - List< Pair<Object, Class >> parameters; |
42 | | - |
43 | | - // generate 4 views with 1000 corresponding beads, single timepoint |
44 | | - SpimData2 spimData = SpimData2.convert( SimulatedBeadsImgLoader.spimdataExample( new int[]{ 0, 90, 135 } ) ); |
45 | | - |
46 | | - // load drosophila |
47 | | - //spimData = new XmlIoSpimData2( "" ).load( "/Users/spreibi/Documents/Microscopy/SPIM/HisYFP-SPIM/dataset.xml" ); |
48 | | - |
49 | | - // select views to process |
50 | | - final List< ViewId > viewIds = new ArrayList< ViewId >(); |
51 | | - viewIds.addAll( spimData.getSequenceDescription().getViewDescriptions().values() ); |
52 | | - |
53 | | - // small part of the bounding box\ |
54 | | - Interval bb = new FinalInterval( new long[] {0, 0, 0 }, new long[] {100, 250, 350} ); |
55 | | - |
56 | | - // downsampling |
57 | | - double downsampling = Double.NaN; //2.0 |
58 | | - |
59 | | - // perforn the fusion virtually |
60 | | - RandomAccessibleInterval< FloatType > virtual = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
61 | | - |
62 | | - // make a physical copy of the virtual randomaccessibleinterval |
63 | | - //final RandomAccessibleInterval< FloatType > fusedImg = FusionTools.copyImg( virtual, new ImagePlusImgFactory<>( new FloatType() ), new FloatType(), null, true ); |
64 | | - |
65 | | - // save as one of the blocks of the N5 |
66 | | - new ImageJ(); |
67 | | - ImageJFunctions.show( virtual ); |
68 | | - |
69 | | - |
70 | | - // task #2 |
71 | | - // small part of the bounding box\ |
72 | | - bb = new FinalInterval( new long[] {101, 0, 0 }, new long[] {200, 250, 350} ); |
73 | | - |
74 | | - // perforn the fusion virtually |
75 | | - final RandomAccessibleInterval< FloatType > virtual2 = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
76 | | - ImageJFunctions.show( virtual2 ); |
77 | | - } |
78 | | - |
79 | | - |
80 | | - public static RandomAccessibleInterval<FloatType> Fusion(String xml, long[] x1, long[] x2) throws SpimDataException{ |
81 | | - System.out.println(xml); |
82 | | - SpimData2 spimData = new XmlIoSpimData2( "" ).load(xml); |
83 | | - Interval bb = new FinalInterval(x1, x2); |
84 | | - |
85 | | - final List< ViewId > viewIds = new ArrayList< ViewId >(); |
86 | | - viewIds.addAll( spimData.getSequenceDescription().getViewDescriptions().values() ); |
87 | | - |
88 | | - double downsampling = Double.NaN; |
89 | | - |
90 | | - final RandomAccessibleInterval< FloatType > virtual = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
91 | | - |
92 | | - return virtual; |
93 | | - } |
| 5 | +// public class FusionParameters |
| 6 | +// { |
| 7 | +// // imput: spimdata (xml) |
| 8 | +// // which views (list of viewid, which is two integers - timepointid, setupid) |
| 9 | +// // bounding box (which part to process) |
| 10 | +// // downsampling |
| 11 | +// // ... |
| 12 | +// |
| 13 | +// } |
| 14 | +// |
| 15 | +// |
| 16 | +// public static void main( String[] args ) throws SpimDataException |
| 17 | +// { |
| 18 | +// // imput: spimdata (xml) |
| 19 | +// // which views (list of viewid, which is two integers - timepointid, setupid) |
| 20 | +// // bounding box (which part to process) |
| 21 | +// // downsampling |
| 22 | +// // ... |
| 23 | +// |
| 24 | +// List< Pair<Object, Class >> parameters; |
| 25 | +// |
| 26 | +// // generate 4 views with 1000 corresponding beads, single timepoint |
| 27 | +// SpimData2 spimData = SpimData2.convert( SimulatedBeadsImgLoader.spimdataExample( new int[]{ 0, 90, 135 } ) ); |
| 28 | +// |
| 29 | +// // load drosophila |
| 30 | +// //spimData = new XmlIoSpimData2( "" ).load( "/Users/spreibi/Documents/Microscopy/SPIM/HisYFP-SPIM/dataset.xml" ); |
| 31 | +// |
| 32 | +// // select views to process |
| 33 | +// final List< ViewId > viewIds = new ArrayList< ViewId >(); |
| 34 | +// viewIds.addAll( spimData.getSequenceDescription().getViewDescriptions().values() ); |
| 35 | +// |
| 36 | +// // small part of the bounding box\ |
| 37 | +// Interval bb = new FinalInterval( new long[] {0, 0, 0 }, new long[] {100, 250, 350} ); |
| 38 | +// |
| 39 | +// // downsampling |
| 40 | +// double downsampling = Double.NaN; //2.0 |
| 41 | +// |
| 42 | +// // perforn the fusion virtually |
| 43 | +// RandomAccessibleInterval< FloatType > virtual = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
| 44 | +// |
| 45 | +// // make a physical copy of the virtual randomaccessibleinterval |
| 46 | +// //final RandomAccessibleInterval< FloatType > fusedImg = FusionTools.copyImg( virtual, new ImagePlusImgFactory<>( new FloatType() ), new FloatType(), null, true ); |
| 47 | +// |
| 48 | +// // save as one of the blocks of the N5 |
| 49 | +// new ImageJ(); |
| 50 | +// ImageJFunctions.show( virtual ); |
| 51 | +// |
| 52 | +// |
| 53 | +// // task #2 |
| 54 | +// // small part of the bounding box\ |
| 55 | +// bb = new FinalInterval( new long[] {101, 0, 0 }, new long[] {200, 250, 350} ); |
| 56 | +// |
| 57 | +// // perforn the fusion virtually |
| 58 | +// final RandomAccessibleInterval< FloatType > virtual2 = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
| 59 | +// ImageJFunctions.show( virtual2 ); |
| 60 | +// } |
| 61 | +// |
| 62 | +// |
| 63 | +// public static RandomAccessibleInterval<FloatType> Fusion(String xml, long[] x1, long[] x2) throws SpimDataException{ |
| 64 | +// System.out.println(xml); |
| 65 | +// SpimData2 spimData = new XmlIoSpimData2( "" ).load(xml); |
| 66 | +// Interval bb = new FinalInterval(x1, x2); |
| 67 | +// |
| 68 | +// final List< ViewId > viewIds = new ArrayList< ViewId >(); |
| 69 | +// viewIds.addAll( spimData.getSequenceDescription().getViewDescriptions().values() ); |
| 70 | +// |
| 71 | +// double downsampling = Double.NaN; |
| 72 | +// |
| 73 | +// final RandomAccessibleInterval< FloatType > virtual = FusionTools.fuseVirtual( spimData, viewIds, bb, downsampling ); |
| 74 | +// |
| 75 | +// return virtual; |
| 76 | +// } |
94 | 77 | } |
0 commit comments