updates
This commit is contained in:
parent
0b3ce96675
commit
0c2c2d21d3
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_2_0.xml
generated
Normal file
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_2_0.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.2.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.2.0/jackson-annotations-2.2.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.2.0/jackson-annotations-2.2.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.2.0/jackson-annotations-2.2.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_2_0.xml
generated
Normal file
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_2_0.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.fasterxml.jackson.core:jackson-core:2.2.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.2.0/jackson-core-2.2.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.2.0/jackson-core-2.2.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.2.0/jackson-core-2.2.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_2_0.xml
generated
Normal file
13
.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_2_0.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: com.fasterxml.jackson.core:jackson-databind:2.2.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.2.0/jackson-databind-2.2.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.2.0/jackson-databind-2.2.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.2.0/jackson-databind-2.2.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
13
.idea/libraries/Maven__gov_nih_imagej_imagej_1_46.xml
generated
Normal file
13
.idea/libraries/Maven__gov_nih_imagej_imagej_1_46.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: gov.nih.imagej:imagej:1.46">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/gov/nih/imagej/imagej/1.46/imagej-1.46.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/gov/nih/imagej/imagej/1.46/imagej-1.46-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/gov/nih/imagej/imagej/1.46/imagej-1.46-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
13
.idea/libraries/Maven__org_jeromq_jeromq_0_2_0.xml
generated
Normal file
13
.idea/libraries/Maven__org_jeromq_jeromq_0_2_0.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="Maven: org.jeromq:jeromq:0.2.0">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/jeromq/jeromq/0.2.0/jeromq-0.2.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/jeromq/jeromq/0.2.0/jeromq-0.2.0-javadoc.jar!/" />
|
||||||
|
</JAVADOC>
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/org/jeromq/jeromq/0.2.0/jeromq-0.2.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</component>
|
15
pom.xml
15
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>ch.psi.zmq</groupId>
|
<groupId>ch.psi.zmq</groupId>
|
||||||
<artifactId>ch.psi.zmq.imagej</artifactId>
|
<artifactId>ch.psi.zmq.imagej</artifactId>
|
||||||
<version>0.4.0</version>
|
<version>0.5.0</version>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -11,11 +11,11 @@
|
|||||||
<artifactId>jeromq</artifactId>
|
<artifactId>jeromq</artifactId>
|
||||||
<version>0.2.0</version>
|
<version>0.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>ch.psi.imagej</groupId>
|
<groupId>ch.psi.imagej</groupId>
|
||||||
<artifactId>ch.psi.imagej.cbf</artifactId>
|
<artifactId>ch.psi.imagej.cbf</artifactId>
|
||||||
<version>0.0.3</version>
|
<version>0.0.3</version>
|
||||||
</dependency>
|
</dependency> -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
@ -31,6 +31,15 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<source>1.7</source>
|
||||||
|
<target>1.7</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>2.4</version>
|
<version>2.4</version>
|
||||||
|
@ -43,8 +43,8 @@ import javax.imageio.stream.ImageInputStream;
|
|||||||
|
|
||||||
import org.jeromq.ZMQ;
|
import org.jeromq.ZMQ;
|
||||||
|
|
||||||
import ch.psi.imagej.cbf.CbfImageReader;
|
//import ch.psi.imagej.cbf.CbfImageReader;
|
||||||
import ch.psi.imagej.cbf.CbfImageReaderSpi;
|
//import ch.psi.imagej.cbf.CbfImageReaderSpi;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonFactory;
|
import com.fasterxml.jackson.core.JsonFactory;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
@ -178,7 +178,9 @@ public class Collector implements Runnable {
|
|||||||
imageSizeX = nImageSizeX;
|
imageSizeX = nImageSizeX;
|
||||||
imageSizeY = nImageSizeY;
|
imageSizeY = nImageSizeY;
|
||||||
|
|
||||||
|
if(img !=null){
|
||||||
img.close();
|
img.close();
|
||||||
|
}
|
||||||
img = null;
|
img = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,75 +236,75 @@ public class Collector implements Runnable {
|
|||||||
numImageUpdates++;
|
numImageUpdates++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (htype == HType.PILATUS_1_0) {
|
// else if (htype == HType.PILATUS_1_0) {
|
||||||
CbfImageReaderSpi spi = new CbfImageReaderSpi();
|
// CbfImageReaderSpi spi = new CbfImageReaderSpi();
|
||||||
ImageInputStream stream = ImageIO.createImageInputStream(new ByteArrayInputStream(content));
|
// ImageInputStream stream = ImageIO.createImageInputStream(new ByteArrayInputStream(content));
|
||||||
CbfImageReader reader = new CbfImageReader(spi);
|
// CbfImageReader reader = new CbfImageReader(spi);
|
||||||
reader.setInput(stream);
|
// reader.setInput(stream);
|
||||||
ImageReadParam param = reader.getDefaultReadParam();
|
// ImageReadParam param = reader.getDefaultReadParam();
|
||||||
int width = reader.getWidth(0);
|
// int width = reader.getWidth(0);
|
||||||
int height = reader.getHeight(0);
|
// int height = reader.getHeight(0);
|
||||||
BufferedImage image = reader.read(0, param);
|
// BufferedImage image = reader.read(0, param);
|
||||||
DataBuffer buffer = image.getData().getDataBuffer();
|
// DataBuffer buffer = image.getData().getDataBuffer();
|
||||||
int bufferType = buffer.getDataType();
|
// int bufferType = buffer.getDataType();
|
||||||
float[] pixels;
|
// float[] pixels;
|
||||||
ImageProcessor ip = null;
|
// ImageProcessor ip = null;
|
||||||
if (buffer instanceof DataBufferFloat) {
|
// if (buffer instanceof DataBufferFloat) {
|
||||||
pixels = ((DataBufferFloat) buffer).getData();
|
// pixels = ((DataBufferFloat) buffer).getData();
|
||||||
ip = new FloatProcessor(width, height, pixels, null);
|
// ip = new FloatProcessor(width, height, pixels, null);
|
||||||
image.flush();
|
// image.flush();
|
||||||
reader.dispose();
|
// reader.dispose();
|
||||||
// TODO
|
// // TODO
|
||||||
// return new ImagePlus(cbfFile.getName(), ip);
|
// // return new ImagePlus(cbfFile.getName(), ip);
|
||||||
} else if (bufferType == DataBuffer.TYPE_INT || bufferType == DataBuffer.TYPE_FLOAT) {
|
// } else if (bufferType == DataBuffer.TYPE_INT || bufferType == DataBuffer.TYPE_FLOAT) {
|
||||||
pixels = new float[width * height];
|
// pixels = new float[width * height];
|
||||||
for (int i = 0; i < pixels.length; i++)
|
// for (int i = 0; i < pixels.length; i++)
|
||||||
pixels[i] = buffer.getElemFloat(i);
|
// pixels[i] = buffer.getElemFloat(i);
|
||||||
ip = new FloatProcessor(width, height, pixels, null);
|
// ip = new FloatProcessor(width, height, pixels, null);
|
||||||
image.flush();
|
// image.flush();
|
||||||
reader.dispose();
|
// reader.dispose();
|
||||||
// TODO
|
// // TODO
|
||||||
// return new ImagePlus(cbfFile.getName(), ip);
|
// // return new ImagePlus(cbfFile.getName(), ip);
|
||||||
} else if (bufferType == DataBuffer.TYPE_DOUBLE) {
|
// } else if (bufferType == DataBuffer.TYPE_DOUBLE) {
|
||||||
pixels = new float[width * height];
|
// pixels = new float[width * height];
|
||||||
boolean clipped = false;
|
// boolean clipped = false;
|
||||||
for (int i = 0; i < pixels.length; i++) {
|
// for (int i = 0; i < pixels.length; i++) {
|
||||||
double doubleValue = buffer.getElemDouble(i);
|
// double doubleValue = buffer.getElemDouble(i);
|
||||||
float floatValue;
|
// float floatValue;
|
||||||
if (doubleValue < Float.MIN_VALUE) {
|
// if (doubleValue < Float.MIN_VALUE) {
|
||||||
floatValue = Float.MIN_VALUE;
|
// floatValue = Float.MIN_VALUE;
|
||||||
clipped = true;
|
// clipped = true;
|
||||||
} else if (doubleValue > Float.MAX_VALUE) {
|
// } else if (doubleValue > Float.MAX_VALUE) {
|
||||||
floatValue = Float.MAX_VALUE;
|
// floatValue = Float.MAX_VALUE;
|
||||||
clipped = true;
|
// clipped = true;
|
||||||
} else {
|
// } else {
|
||||||
floatValue = (float) doubleValue;
|
// floatValue = (float) doubleValue;
|
||||||
}
|
// }
|
||||||
pixels[i] = floatValue;
|
// pixels[i] = floatValue;
|
||||||
}
|
// }
|
||||||
if (clipped) {
|
// if (clipped) {
|
||||||
IJ.log("Warning: pixel value(s) clipped to fit in type float");
|
// IJ.log("Warning: pixel value(s) clipped to fit in type float");
|
||||||
}
|
// }
|
||||||
ip = new FloatProcessor(width, height, pixels, null);
|
// ip = new FloatProcessor(width, height, pixels, null);
|
||||||
image.flush();
|
// image.flush();
|
||||||
reader.dispose();
|
// reader.dispose();
|
||||||
// TODO
|
// // TODO
|
||||||
// return new ImagePlus(cbfFile.getName(), ip);
|
// // return new ImagePlus(cbfFile.getName(), ip);
|
||||||
} else {
|
// } else {
|
||||||
reader.dispose();
|
// reader.dispose();
|
||||||
// TODO
|
// // TODO
|
||||||
// return new ImagePlus(cbfFile.getName(), image);
|
// // return new ImagePlus(cbfFile.getName(), image);
|
||||||
}
|
// }
|
||||||
if(img==null){
|
// if(img==null){
|
||||||
img = new ImagePlus("", ip);
|
// img = new ImagePlus("", ip);
|
||||||
img.show();
|
// img.show();
|
||||||
}
|
// }
|
||||||
else{
|
// else{
|
||||||
img.setProcessor(ip);
|
// img.setProcessor(ip);
|
||||||
img.updateAndDraw();
|
// img.updateAndDraw();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.log(Level.SEVERE, "UpdateImage got exception", ex);
|
logger.log(Level.SEVERE, "UpdateImage got exception", ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user