Convert HoloJ processor to an ImagePlus

Tags: #<Tag:0x00007fd5400fe520> #<Tag:0x00007fd5400fe368>


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);
        return fp;

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

Thank you in advance.


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)


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.