Login  Register

Re: How to flatten an ImageCanvas?

Posted by Michael Schmid on Nov 24, 2016; 4:13pm
URL: http://imagej.273.s1.nabble.com/How-to-flatten-an-ImageCanvas-tp5017622p5017626.html

Hi Philippe,

mind that ImagePlus.flatten returns a flattened ImagePlus, it does not
modify the original.

Or could it be that you want the opposite of 'flatten'?

'flatten' writes the lines and other objects currently present as
overlay into the image, modifying the image data.

'drawLine' (ImageProcessor, not ImageCanvas method) irreversibly draws a
line by modifying the pixels. The same is true for the macro drawLine
command (not for macro Overlay.drawLine).
You cannot convert that into an overlay any more, and you cannot recover
the pixel data that were overwritten.


Michael
________________________________________________________________

On 2016-11-24 16:45, CARL Philippe (PHA) wrote:

> Dear John,
> I had already tried it, and it wasn't working. Unfortunately...
> My best regards,
> Philippe
>
> Le Jeudi 24 Novembre 2016 15:33 CET, John Hayes <[hidden email]> a écrit:
>
>> Hi Philippe,
>>
>> I believe the easiest way is to simply call the “flatten” method of the corresponding ImagePlus instance:
>> https://imagej.nih.gov/ij/developer/api/ij/ImagePlus.html#flatten--
>>
>> Cheers,
>> John
>>
>>> On Nov 24, 2016, at 9:25 AM, Philippe CARL <[hidden email]> wrote:
>>>
>>> Dear all,
>>>
>>> I have an ImagePlus for which lines (= drawLine(int x1, int y1, int x2, int
>>> y2))are drawn on its ImageCanvas.
>>>
>>> How is it possible to make a kind of flatten of these drawn lines in order
>>> to be able to save them on top of the ImagePlus?
>>>
>>> I thank you very much in advance for your 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
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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