[BioC] alternative for drawtext function in EBImage?
Joseph Barry
joseph.barry at embl.de
Fri Mar 21 09:59:26 CET 2014
Dear Djordje,
It might be that you need a new function to colour cells according to their lineage. A more ‘deterministic’ version of the colorLabels() function would be required. It is difficult to be more specific without knowing precisely how you store the tracks.
Best wishes,
Joseph
On 20 Mar 2014, at 22:17, Andrzej Oleś <andrzej.oles at gmail.com> wrote:
> Dear Djordje,
>
> thank you for your inquiry and your interest in EBImage!
>
> Unfortunately, the 'drawtext' function is defunct since EBImage v. 4.0
> and there is no replacement function for now. Drawing text on images
> in the previous versions was facilitated by the ImageMagick library.
> However, dealing with the external dependencies was a hassle for a
> substantial group of end-users, and we were also not comfortable with
> relying on third party software. Therefore, when moving from version
> 3.xx to 4.0 the decision was made to decouple the package from these
> dependencies, even by sacrificing some of the functionality previously
> provided by ImageMagic.
>
> Nevertheless, you might find the 'paintObjects' function useful for
> highlighting your objects of interest. Masks for object highlighting
> can be conveniently constructed using the 'bwlabel' and 'rmObjects'
> functions, as illustrated in the example code below.
>
> Hope this helps.
>
> Cheers,
> Andrzej
>
> ### Object highlighting example
>
> library(EBImage)
>
> ## binary Image containing objects
> x = readImage(system.file('images'
> , 'shapes.png', package='EBImage'))
> x = x[128:512,1:128]
> display(x)
>
> ## label objects
> y = bwlabel(x)
> labels = sort(unique(as.vector(y[y>0])))
>
> ## create object mask by removing all objects except the 5th one
> mask = rmObjects(y, labels[-5])
>
> ## create a color Image with the 5th object highlighted
> x = channel(x, 'rgb')
> display(paintObjects(mask, x, thick=TRUE))
>
>
> On Thu, Mar 20, 2014 at 9:13 PM, Djordje Bajic <je.li.bre at gmail.com> wrote:
>> Thanks for the response Joseph,
>>
>> I need in fact to follow the tracks explicitly, because I need to identify
>> which cells in the image n+1 are the daughters of a given cell in the image
>> n (in fact, EBImage also provides a function to highlight the segmentation
>> by drawing contours).
>>
>>
>> 2014-03-20 21:01 GMT+01:00 Joseph Barry <joebarry.mail at gmail.com>:
>>
>>> Dear Djordje,
>>>
>>> For starters I would recommend that you check out the
>>> highlightSegmentation() function from the imageHTS package.
>>>
>>> Is it sufficient for you to visualise the segmentation (in which case the
>>> above will suffice) or do you need to follow the tracks explicitly?
>>>
>>> Best wishes,
>>> Joseph
>>>
>>> On 20 Mar 2014, at 19:30, Djordje Bajic [guest] <guest at bioconductor.org>
>>> wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> I have seen that "drawtext" and "drawfont" ahev become deprecated
>>> functions; is there an available alternative to draw objects at EBImage
>>> displayed images?
>>>>
>>>> I need this featrue as I am trying to track lineages of cells that
>>> divide along a stack of photos.
>>>>
>>>> Thanks for the help!
>>>>
>>>> -- output of sessionInfo():
>>>>
>>>> sessionInfo()
>>>> R version 3.0.3 (2014-03-06)
>>>> Platform: x86_64-pc-linux-gnu (64-bit)
>>>>
>>>> locale:
>>>> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
>>>> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
>>>> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
>>>> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
>>>> [9] LC_ADDRESS=C LC_TELEPHONE=C
>>>> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>>>
>>>> attached base packages:
>>>> [1] grid parallel splines stats graphics grDevices utils
>>>> [8] datasets methods base
>>>>
>>>> other attached packages:
>>>> [1] reshape_0.8.4 plyr_1.8 gridExtra_0.9.1
>>> ggplot2_0.9.3.1
>>>> [5] Defaults_1.1-1 CRImage_1.8.0 aCGH_1.38.0
>>> multtest_2.16.0
>>>> [9] Biobase_2.20.1 BiocGenerics_0.6.0 survival_2.37-7
>>> cluster_1.14.4
>>>> [13] DNAcopy_1.34.0 EBImage_4.2.1
>>>>
>>>> loaded via a namespace (and not attached):
>>>> [1] abind_1.4-0 class_7.3-9 codetools_0.2-8
>>> colorspace_1.2-4
>>>> [5] compiler_3.0.3 dichromat_2.0-0 digest_0.6.4 e1071_1.6-2
>>>> [9] foreach_1.4.1 gtable_0.1.2 iterators_1.0.6 jpeg_0.1-8
>>>> [13] labeling_0.2 lattice_0.20-24 locfit_1.5-9.1 MASS_7.3-29
>>>> [17] munsell_0.4.2 png_0.1-7 proto_0.3-10
>>> RColorBrewer_1.0-5
>>>> [21] reshape2_1.2.2 scales_0.2.3 sgeostat_1.0-25
>>> stats4_3.0.3
>>>> [25] stringr_0.6.2 tiff_0.1-5 tools_3.0.3
>>>>
>>>>
>>>> --
>>>> Sent via the guest posting facility at bioconductor.org.
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor at r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives:
>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>
>>>
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
More information about the Bioconductor
mailing list