Conversion to 8-bit in java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Conversion to 8-bit in java

CARL Philippe (LBP)
Dear all,

I have two ImagePlus i1 and i2 which I would like to convert from
ImagePlus.GRAY32 to ImagePlus.GRAY8 by using IJ.run(i1, "8-bit", ""); and
IJ.run(i2, "8-bit", "");

But as the first picture gets correctly converted, the second one is staying
in ImagePlus.GRAY32.

So what am I missing here?

I thank you very much in advance for your answer and help.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Biophotonique et Pharmacologie

UMR 7213 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 8-bit in java

Ignacio Arganda-Carreras-2
Hello Philippe,

Can you paste your code here? I just tried on a simple script and those
commands work as expected for me.

ignacio

On Mon, Feb 29, 2016 at 4:39 PM, Philippe CARL <[hidden email]>
wrote:

> Dear all,
>
> I have two ImagePlus i1 and i2 which I would like to convert from
> ImagePlus.GRAY32 to ImagePlus.GRAY8 by using IJ.run(i1, "8-bit", ""); and
> IJ.run(i2, "8-bit", "");
>
> But as the first picture gets correctly converted, the second one is
> staying
> in ImagePlus.GRAY32.
>
> So what am I missing here?
>
> I thank you very much in advance for your answer and help.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Ikerbasque Research Fellow
Departamento de Ciencias de la Computacion e Inteligencia Artificial
Facultad de Informatica, Universidad del Pais Vasco
Paseo de Manuel Lardizabal, 1
20018 Donostia-San Sebastian
Guipuzcoa, Spain

Phone : +34 943 01 73 25
Website: http://sites.google.com/site/iargandacarreras/
<http://biocomp.cnb.csic.es/~iarganda/index_EN.html>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 8-bit in java

CARL Philippe (LBP)
Dear Ignacio,
You will be able to find the code I was working on under the following link:
http://punias.free.fr/ImageJ/Colocalization_Finder.java
Since then I was able to solve my issue using the following thread (with the answer Kota gave there):
http://stackoverflow.com/questions/23065325/java-for-imagej-how-to-convert-an-image-from-rgb-to-8-bit-using-code
But it is indeed strange that it wasn't working with the IJ.run version of the code.
My best regards,
Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Ignacio Arganda-Carreras
Envoyé : jeudi 3 mars 2016 14:19
À : [hidden email]
Objet : Re: Conversion to 8-bit in java

Hello Philippe,

Can you paste your code here? I just tried on a simple script and those commands work as expected for me.

ignacio

On Mon, Feb 29, 2016 at 4:39 PM, Philippe CARL <[hidden email]>
wrote:

> Dear all,
>
> I have two ImagePlus i1 and i2 which I would like to convert from
> ImagePlus.GRAY32 to ImagePlus.GRAY8 by using IJ.run(i1, "8-bit", "");
> and IJ.run(i2, "8-bit", "");
>
> But as the first picture gets correctly converted, the second one is
> staying in ImagePlus.GRAY32.
>
> So what am I missing here?
>
> I thank you very much in advance for your answer and help.
>
> My best regards,
>
> Philippe
>
>
>
> Philippe CARL
>
> Laboratoire de Biophotonique et Pharmacologie
>
> UMR 7213 CNRS - Université de Strasbourg
>
> Faculté de Pharmacie
>
> 74 route du Rhin
>
> 67401 ILLKIRCH
>
> Tel : +33(0)3 68 85 41 84
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Ikerbasque Research Fellow
Departamento de Ciencias de la Computacion e Inteligencia Artificial Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel Lardizabal, 1
20018 Donostia-San Sebastian
Guipuzcoa, Spain

Phone : +34 943 01 73 25
Website: http://sites.google.com/site/iargandacarreras/
<http://biocomp.cnb.csic.es/~iarganda/index_EN.html>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 8-bit in java

Ignacio Arganda-Carreras-2
In reply to this post by Ignacio Arganda-Carreras-2
Hello Philippe,

I could reproduce the error with your code. Very weird indeed!

ignacio

On Thu, Mar 3, 2016 at 2:36 PM, Philippe CARL <[hidden email]>
wrote:

> Dear Ignacio,
> You will be able to find the code I was working on under the following
> link:
> http://punias.free.fr/ImageJ/Colocalization_Finder.java
> Since then I was able to solve my issue using the following thread (with
> the answer Kota gave there):
>
> http://stackoverflow.com/questions/23065325/java-for-imagej-how-to-convert-an-image-from-rgb-to-8-bit-using-code
> But it is indeed strange that it wasn't working with the IJ.run version of
> the code.
> My best regards,
> Philippe
>
> -----Message d'origine-----
> De : ImageJ Interest Group [mailto:[hidden email]] De la part de
> Ignacio Arganda-Carreras
> Envoyé : jeudi 3 mars 2016 14:19
> À : [hidden email]
> Objet : Re: Conversion to 8-bit in java
>
> Hello Philippe,
>
> Can you paste your code here? I just tried on a simple script and those
> commands work as expected for me.
>
> ignacio
>
> On Mon, Feb 29, 2016 at 4:39 PM, Philippe CARL <[hidden email]>
> wrote:
>
> > Dear all,
> >
> > I have two ImagePlus i1 and i2 which I would like to convert from
> > ImagePlus.GRAY32 to ImagePlus.GRAY8 by using IJ.run(i1, "8-bit", "");
> > and IJ.run(i2, "8-bit", "");
> >
> > But as the first picture gets correctly converted, the second one is
> > staying in ImagePlus.GRAY32.
> >
> > So what am I missing here?
> >
> > I thank you very much in advance for your answer and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Biophotonique et Pharmacologie
> >
> > UMR 7213 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
>
>
> --
> Ignacio Arganda-Carreras, Ph.D.
> Ikerbasque Research Fellow
> Departamento de Ciencias de la Computacion e Inteligencia Artificial
> Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel
> Lardizabal, 1
> 20018 Donostia-San Sebastian
> Guipuzcoa, Spain
>
> Phone : +34 943 01 73 25
> Website: http://sites.google.com/site/iargandacarreras/
> <http://biocomp.cnb.csic.es/~iarganda/index_EN.html>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Ikerbasque Research Fellow
Departamento de Ciencias de la Computacion e Inteligencia Artificial
Facultad de Informatica, Universidad del Pais Vasco
Paseo de Manuel Lardizabal, 1
20018 Donostia-San Sebastian
Guipuzcoa, Spain

Phone : +34 943 01 73 25
Website: http://sites.google.com/site/iargandacarreras/
<http://biocomp.cnb.csic.es/~iarganda/index_EN.html>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Conversion to 8-bit in java

CARL Philippe (LBP)
Dear Ignacio,
From a discussion with Michael, there is maybe a bug within ImageJ (but this hypothesis isn't confirmed) or maybe also a stupid mistake or error I introduced within the plugin I gave you the link.
Unfortunately I'm afraid that my level isn't good enough in order to track down the origin of such a weird behavior.
So good luck to figure it out.
My best regards,
Philippe

-----Message d'origine-----
De : ImageJ Interest Group [mailto:[hidden email]] De la part de Ignacio Arganda-Carreras
Envoyé : jeudi 3 mars 2016 14:57
À : [hidden email]
Objet : Re: Conversion to 8-bit in java

Hello Philippe,

I could reproduce the error with your code. Very weird indeed!

ignacio

On Thu, Mar 3, 2016 at 2:36 PM, Philippe CARL <[hidden email]>
wrote:

> Dear Ignacio,
> You will be able to find the code I was working on under the following
> link:
> http://punias.free.fr/ImageJ/Colocalization_Finder.java
> Since then I was able to solve my issue using the following thread
> (with the answer Kota gave there):
>
> http://stackoverflow.com/questions/23065325/java-for-imagej-how-to-con
> vert-an-image-from-rgb-to-8-bit-using-code
> But it is indeed strange that it wasn't working with the IJ.run
> version of the code.
> My best regards,
> Philippe
>
> -----Message d'origine-----
> De : ImageJ Interest Group [mailto:[hidden email]] De la part de
> Ignacio Arganda-Carreras Envoyé : jeudi 3 mars 2016 14:19 À :
> [hidden email] Objet : Re: Conversion to 8-bit in java
>
> Hello Philippe,
>
> Can you paste your code here? I just tried on a simple script and
> those commands work as expected for me.
>
> ignacio
>
> On Mon, Feb 29, 2016 at 4:39 PM, Philippe CARL
> <[hidden email]>
> wrote:
>
> > Dear all,
> >
> > I have two ImagePlus i1 and i2 which I would like to convert from
> > ImagePlus.GRAY32 to ImagePlus.GRAY8 by using IJ.run(i1, "8-bit",
> > ""); and IJ.run(i2, "8-bit", "");
> >
> > But as the first picture gets correctly converted, the second one is
> > staying in ImagePlus.GRAY32.
> >
> > So what am I missing here?
> >
> > I thank you very much in advance for your answer and help.
> >
> > My best regards,
> >
> > Philippe
> >
> >
> >
> > Philippe CARL
> >
> > Laboratoire de Biophotonique et Pharmacologie
> >
> > UMR 7213 CNRS - Université de Strasbourg
> >
> > Faculté de Pharmacie
> >
> > 74 route du Rhin
> >
> > 67401 ILLKIRCH
> >
> > Tel : +33(0)3 68 85 41 84
> >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
>
>
> --
> Ignacio Arganda-Carreras, Ph.D.
> Ikerbasque Research Fellow
> Departamento de Ciencias de la Computacion e Inteligencia Artificial
> Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel
> Lardizabal, 1
> 20018 Donostia-San Sebastian
> Guipuzcoa, Spain
>
> Phone : +34 943 01 73 25
> Website: http://sites.google.com/site/iargandacarreras/
> <http://biocomp.cnb.csic.es/~iarganda/index_EN.html>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Ignacio Arganda-Carreras, Ph.D.
Ikerbasque Research Fellow
Departamento de Ciencias de la Computacion e Inteligencia Artificial Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel Lardizabal, 1
20018 Donostia-San Sebastian
Guipuzcoa, Spain

Phone : +34 943 01 73 25
Website: http://sites.google.com/site/iargandacarreras/
<http://biocomp.cnb.csic.es/~iarganda/index_EN.html>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html