public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* ImagJ/Fiji 'binding' wrong argument type - help welcome
@ 2018-01-21  3:37 David Pirotte
  0 siblings, 0 replies; only message in thread
From: David Pirotte @ 2018-01-21  3:37 UTC (permalink / raw)
  To: kawa

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

Hi again,

While expecting some help wrt my previous message, I tried another 'binding' using
another class of the same plugin [1]

This time, though I will later want to avoid it, I wrote 'binding' so it calls the
imagej/fiji 'ecosystem', which means calling the procedure "run", defined in ij.IJ
(which I 'bind' in my ij-core.scm module). This works fine, but then my problem is
to get access to the result, see:

1-

  (import (ij-core))

  (export ij-geometry-to-distance-map)

  (define (ij-geometry-to-distance-map iplus1 #!optional (threshold 128))
    (ij-run iplus1
            "Geometry to Distance Map"
            (string-append "threshold="
                           (number->string threshold))))

then

  export CLASSPATH=.:./jars/ij.jar:./jars/local-thickness.jar
  kawa -C ij-local-thickness.scm

and using it

  david@capac:~/lpdi/projects/kawa 16 $ kawa -Dplugins.dir=/usr/lpdi/projects/kawa/jars
  #|kawa:1|# (import (ij-core)
          (ij-local-thickness))
  #|.....2|# #|kawa:3|# (define iplus1 (ij-open "images/camada-mapa.png"))
  #|kawa:4|# (ij-geometry-to-distance-map iplus1)
  #!null
  #|kawa:5|# 

perfect, but I don't get the resulted computed image, because "run" doesn't return
anything in their ecosystem with their string based API


2-

I add a binding to the getResultImage of that class

  (define-alias get-result-image-edt
    sc.fiji.localThickness.EDT_S1D:getResultImage)

I use it, and I pass a wrong first argument on purpose, to see
what the system expects:

  (define (ij-geometry-to-distance-map iplus1 #!optional (threshold 128))
    (ij-run iplus1
            "Geometry to Distance Map"
            (string-append "threshold="
                           (number->string threshold)))
    (get-result-image-edt iplus1))

-|
...
#|kawa:4|# (ij-geometry-to-distance-map iplus1)
Argument #1 (null) to 'sc.fiji.localThickness.EDT_S1D.getResultImage()' has wrong type (expected: sc.fiji.localThickness.EDT_S1D)


So it seems that these methods (including the one in my previous mail), expect as
their first argument the instance of the class upon which to run the code ...

But how do I get access to the instance created by imagej or
these plugin classes?


Thanks,
David

[1] https://github.com/fiji/LocalThickness/blob/master/src/main/java/sc/fiji/localThickness/EDT_S1D.java

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-21  3:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-21  3:37 ImagJ/Fiji 'binding' wrong argument type - help welcome David Pirotte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).