Convert HoloJ processor to an ImagePlus

java
imagej
Tags: #<Tag:0x00007fb87e2e01d8> #<Tag:0x00007fb87e2e0048>

#1

Hi, has anyone any experience developing with the HoloJ suite. Basically, I have my holoJ processor and I’d like to show it in a window. Ive tried the .show() but as far as I’m aware this only works on an ImagePlus. Does anyone know how to covert my HoloJprocessor to a ImagePlus image or has another solution to my problem. I haven’t posted the code up because its very large but my Idea is something like this

public floatProcessor convert()
{
  FloatProcessor fp = new  FloatProcessor(width, height) ;
   int size = width * height;
   float[] farray = new float[ size ];
        for (int k=0; k<size; k++)
        {
            farray[k] = (float)(Some way to cast each pixel value);
	}
        fp.setPixels(farray);
        return fp;
}

Then I just convert the float processor to an imagePlus using ImageJ.

Thank you in advance.


#2

Did you have a look at the HoloJProcessor API documentation? It provides the methods:

ij.process.FloatProcessor 	createAmplitudeProcessor()
ij.process.FloatProcessor 	createPhaseProcessor()
ij.process.FloatProcessor 	createPowerSpectrumProcessor()
ij.process.FloatProcessor 	createSpectrumProcessor()

as well as the corresponding make*Image() versions the return an ImagePlus:

ij.ImagePlus 	makeAmplitudeImage(java.lang.String title)
ij.ImagePlus 	makePhaseImage(java.lang.String title)
ij.ImagePlus 	makePowerSpectrumImage(java.lang.String title)
ij.ImagePlus 	makeSpectrumImage(java.lang.String title)

#3

Hi Jan, yea I did. I’m trying to follow what he’s doing in each create***Processor() with the method I put up, He uses a second method in holoJutills called make***Processor() which is used in the for loop of the create Processor methods. I was just curious to see if there was a simple work around for putting the holoJ processor into and imagePlus.