Hello,
kawa script using mpicbg_-1.0.2.jar -> ERROR "Linear Stack Alignment with SIFT" does not work when scripting using kawa [or clojure by the way] Note: the images we use are too big to send them here, but who might help probably knows the mpicbg source code and has images to test locally ... ~/lpdi/projects/kawa jars/ ij-1.49v.jar ij.jar -> ij-1.49v.jar mpicbg_-1.0.2.jar mpicbg.jar -> mpicbg_-1.0.2.jar ij-core.scm ij$Mncore.class Session example: david@capac:~/lpdi/projects/kawa 67 $ export CLASSPATH=.:./jars/ij.jar:./jars/mpicbg.jar david@capac:~/lpdi/projects/kawa 68 $ kawa -Dplugins.dir=./jars #|kawa:1|# (import (ij-core)) #|kawa:2|# (define iplus1 (ij-open "/usr/lpdi/projects/tests/mfer/vale/dipe/mosaic1/bf.png")) #|kawa:3|# (define iplus2 (ij-open "/usr/lpdi/projects/tests/mfer/vale/dipe/mosaic1/cpol.png")) #|kawa:4|# (ij-show iplus1) #|kawa:6|# (ij-show iplus2) #|kawa:7|# (ij-run "Images to Stack" "method=[Copy (center)] name=Stack title=[] use") #|kawa:9|# (ij-run "Linear Stack Alignment with SIFT" "initial_gaussian_blur=1.60 steps_per_scale_octave=3 minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 maximal_alignment_error=25 inlier_ratio=0.05 expected_transformation=Translation interpolate") -> Class not found while attempting to run "SIFT_Align" java.lang.NoClassDefFoundError: mpicbg/models/TranslationModel2D Indeed, it is not in mpcibg.jar [see below] Anyone can give me some hint? Thanks, David david@capac:~/lpdi/projects/kawa/jars 358 $ jar tf mpicbg.jar META-INF/ META-INF/MANIFEST.MF mpicbg/ mpicbg/ij/ mpicbg/ij/clahe/ mpicbg/ij/plugin/ Find_PointRoi.class LICENSE MOPS_ExtractPointRoi$1.class MOPS_ExtractPointRoi$Param.class MOPS_ExtractPointRoi.class mpicbg/ij/clahe/PlugIn.class mpicbg/ij/plugin/AbstractBlockFilter.class mpicbg/ij/plugin/AbstractBlockStatistics.class mpicbg/ij/plugin/AlignStacksWithLandmarks.class mpicbg/ij/plugin/DiffusionMask.class mpicbg/ij/plugin/ElasticAlign$1.class mpicbg/ij/plugin/ElasticAlign$2.class mpicbg/ij/plugin/ElasticAlign$Features.class mpicbg/ij/plugin/ElasticAlign$Param.class mpicbg/ij/plugin/ElasticAlign$PointMatches.class mpicbg/ij/plugin/ElasticAlign$Triple.class mpicbg/ij/plugin/ElasticAlign.class mpicbg/ij/plugin/ElasticMontage$1.class mpicbg/ij/plugin/ElasticMontage$2.class mpicbg/ij/plugin/ElasticMontage$Features.class mpicbg/ij/plugin/ElasticMontage$Param.class mpicbg/ij/plugin/ElasticMontage$PointMatches.class mpicbg/ij/plugin/ElasticMontage$Triple.class mpicbg/ij/plugin/ElasticMontage.class mpicbg/ij/plugin/Mean.class mpicbg/ij/plugin/MSEBlockFlow.class mpicbg/ij/plugin/MSEGaussianFlow.class mpicbg/ij/plugin/NormalizeLocalContrast.class mpicbg/ij/plugin/PMCCBlockFlow.class mpicbg/ij/plugin/RemoveOutliers.class mpicbg/ij/plugin/RemoveSaturated.class mpicbg/ij/plugin/SampleVariance.class mpicbg/ij/plugin/StandardDeviation.class plugins.config SIFT_Align$1.class SIFT_Align$Param.class SIFT_Align.class SIFT_ExtractPointRoi$1.class SIFT_ExtractPointRoi$Param.class SIFT_ExtractPointRoi.class SIFT_Test.class Stack_Rotate$1.class Stack_Rotate$GUI.class Stack_Rotate$MappingThread.class Stack_Rotate.class Transform_Affine.class Transform_MovingLeastSquaresMesh.class Transform_Perspective.class Transform_RegularizedAffine.class Transform_Rigid.class Transform_Roi.class Transform_Similarity.class Transform_SpringMesh$IllustrateThread.class Transform_SpringMesh$OptimizeThread.class Transform_SpringMesh.class META-INF/maven/ META-INF/maven/mpicbg/ META-INF/maven/mpicbg/mpicbg_/ META-INF/maven/mpicbg/mpicbg_/pom.xml META-INF/maven/mpicbg/mpicbg_/pom.properties -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
You need mpicbg-1.0.2.jar and mpicbg_-1.0.2.jar, the latter contains
ImageJ related classes (plugins and such, therefore the _) and has the first as dependency which does all the work. Hope that's it. Cheers, Stephan On Wed, 2015-10-14 at 17:18 -0300, David Pirotte wrote: > Hello, > > kawa script using mpicbg_-1.0.2.jar > -> ERROR > > "Linear Stack Alignment with SIFT" does not work when scripting using kawa [or > clojure by the way] > > Note: the images we use are too big to send them here, but who might > help probably knows the mpicbg source code and has images to > test locally ... > > ~/lpdi/projects/kawa > jars/ > ij-1.49v.jar > ij.jar -> ij-1.49v.jar > mpicbg_-1.0.2.jar > mpicbg.jar -> mpicbg_-1.0.2.jar > ij-core.scm > ij$Mncore.class > > Session example: > > david@capac:~/lpdi/projects/kawa 67 $ export CLASSPATH=.:./jars/ij.jar:./jars/mpicbg.jar > david@capac:~/lpdi/projects/kawa 68 $ kawa -Dplugins.dir=./jars > #|kawa:1|# (import (ij-core)) > #|kawa:2|# (define iplus1 (ij-open "/usr/lpdi/projects/tests/mfer/vale/dipe/mosaic1/bf.png")) > #|kawa:3|# (define iplus2 (ij-open "/usr/lpdi/projects/tests/mfer/vale/dipe/mosaic1/cpol.png")) > #|kawa:4|# (ij-show iplus1) > #|kawa:6|# (ij-show iplus2) > #|kawa:7|# (ij-run "Images to Stack" "method=[Copy (center)] name=Stack title=[] use") > #|kawa:9|# (ij-run "Linear Stack Alignment with SIFT" "initial_gaussian_blur=1.60 steps_per_scale_octave=3 minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 maximal_alignment_error=25 inlier_ratio=0.05 expected_transformation=Translation interpolate") > > -> > Class not found while attempting to run "SIFT_Align" > java.lang.NoClassDefFoundError: mpicbg/models/TranslationModel2D > > Indeed, it is not in mpcibg.jar [see below] > > Anyone can give me some hint? > > Thanks, > David > > > david@capac:~/lpdi/projects/kawa/jars 358 $ jar tf mpicbg.jar > META-INF/ > META-INF/MANIFEST.MF > mpicbg/ > mpicbg/ij/ > mpicbg/ij/clahe/ > mpicbg/ij/plugin/ > Find_PointRoi.class > LICENSE > MOPS_ExtractPointRoi$1.class > MOPS_ExtractPointRoi$Param.class > MOPS_ExtractPointRoi.class > mpicbg/ij/clahe/PlugIn.class > mpicbg/ij/plugin/AbstractBlockFilter.class > mpicbg/ij/plugin/AbstractBlockStatistics.class > mpicbg/ij/plugin/AlignStacksWithLandmarks.class > mpicbg/ij/plugin/DiffusionMask.class > mpicbg/ij/plugin/ElasticAlign$1.class > mpicbg/ij/plugin/ElasticAlign$2.class > mpicbg/ij/plugin/ElasticAlign$Features.class > mpicbg/ij/plugin/ElasticAlign$Param.class > mpicbg/ij/plugin/ElasticAlign$PointMatches.class > mpicbg/ij/plugin/ElasticAlign$Triple.class > mpicbg/ij/plugin/ElasticAlign.class > mpicbg/ij/plugin/ElasticMontage$1.class > mpicbg/ij/plugin/ElasticMontage$2.class > mpicbg/ij/plugin/ElasticMontage$Features.class > mpicbg/ij/plugin/ElasticMontage$Param.class > mpicbg/ij/plugin/ElasticMontage$PointMatches.class > mpicbg/ij/plugin/ElasticMontage$Triple.class > mpicbg/ij/plugin/ElasticMontage.class > mpicbg/ij/plugin/Mean.class > mpicbg/ij/plugin/MSEBlockFlow.class > mpicbg/ij/plugin/MSEGaussianFlow.class > mpicbg/ij/plugin/NormalizeLocalContrast.class > mpicbg/ij/plugin/PMCCBlockFlow.class > mpicbg/ij/plugin/RemoveOutliers.class > mpicbg/ij/plugin/RemoveSaturated.class > mpicbg/ij/plugin/SampleVariance.class > mpicbg/ij/plugin/StandardDeviation.class > plugins.config > SIFT_Align$1.class > SIFT_Align$Param.class > SIFT_Align.class > SIFT_ExtractPointRoi$1.class > SIFT_ExtractPointRoi$Param.class > SIFT_ExtractPointRoi.class > SIFT_Test.class > Stack_Rotate$1.class > Stack_Rotate$GUI.class > Stack_Rotate$MappingThread.class > Stack_Rotate.class > Transform_Affine.class > Transform_MovingLeastSquaresMesh.class > Transform_Perspective.class > Transform_RegularizedAffine.class > Transform_Rigid.class > Transform_Roi.class > Transform_Similarity.class > Transform_SpringMesh$IllustrateThread.class > Transform_SpringMesh$OptimizeThread.class > Transform_SpringMesh.class > META-INF/maven/ > META-INF/maven/mpicbg/ > META-INF/maven/mpicbg/mpicbg_/ > META-INF/maven/mpicbg/mpicbg_/pom.xml > META-INF/maven/mpicbg/mpicbg_/pom.properties > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hello Stephan,
> You need mpicbg-1.0.2.jar and mpicbg_-1.0.2.jar, the latter contains > ImageJ related classes (plugins and such, therefore the _) and has the > first as dependency which does all the work. Thanks, that solved the above. Now I have 2 other problems: (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display images on the screen, which is required to call "Images to Stack": (a) I want to open images in memory only and built the stack myself, example(s) [preferably kawa/clojure of course since I use kawa] welcome; (b) "Linear Stack Alignment with SIFT" does not expect/accept a stack argument, I would need, if possible, that you implement a version that accept a stack instead of 'magically' grab the one fiji creates when calling "Images to Stack" time: would that be possible? (2) The following should be easier to solve, especially after I solve (1.a), but for the record: (a) when using fiji, "Images to Stack" closes all image windows and reopen a new 1 which appears to be the stack displaying the first image; when scripting this re-opening does not happen (b) because of the above, which seems mandatory, "Stack to Images" fails when scripting, but even if it did, that would still not be sufficient for us, since I want to save the stack as new images on disk: how do I get the new iplus of all images '...aligned...' on the stack? As you understood already, it is extremely important for us, I should say mandatory actually, that absolutely everything happens in memory and no windows is/needs to be opened during the execution of the script. Thanks, David -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
Hi David,
> (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display images on > the screen, which is required to call "Images to Stack": > > (a) I want to open images in memory only and built the stack myself, > example(s) [preferably kawa/clojure of course since I use kawa] > welcome; > > (b) "Linear Stack Alignment with SIFT" does not expect/accept a stack > argument, I would need, if possible, that you implement a version > that accept a stack instead of 'magically' grab the one fiji creates > when calling "Images to Stack" time: > > would that be possible? > No, it is unnecessary because the ImageJ and mpicbg API have lots of public methods that allow fine grained access to all its functionality. You will have to read about and learn it and then you will realize that both (1) and (2) are strange things to ask for ;). E.g., if you want to keep doing what you propose which is clearly the result of not having spent sufficient time with it, you could call http://rsb.info.nih.gov/ij/developer/api/ij/IJ.html#run-ij.ImagePlus-java.lang.String-java.lang.String- as making an ImagePlus from an ImageStack is as simple as http://rsb.info.nih.gov/ij/developer/api/ij/ImagePlus.html#ImagePlus-java.lang.String-ij.ImageStack- and > As you understood already, it is extremely important for us, I should say mandatory > actually, that absolutely everything happens in memory and no windows is/needs to > be opened during the execution of the script. > everything you're talking about happens in memory. If you do not want UI, use the API directly instead of plugins whose sole purpose is to provide a UI to some functions. Good luck, Stephan -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
FWIW, although I haven¹t gotten around to wrapping the SIFT alignment code
for concise Clojure access, if you have funimage installed (update site: http://sites.imagej.net/Funimage/) you can do this in the Clojure interpreter: (use Œfunimage.imp) (let [original (open-imp "http://imagej.net/images/blobs.gif")] (show-imp (zconcat-imps (map #(% (copy-imp original)) [smooth dilate erode invert])))) This will call the 4 functions that are being mapped over, create 4 new ImagePlus(es), apply the functions, and concatenate them as a Z-stack. Note that the functions: smooth, dilate, erode, and invert *are* mutable, hence the original image is copied prior to the function applications. If any particular functions should have more natural names, then feel free to bring it up or send a pull request. Cheers, Kyle -- Kyle I S Harrington, PhD Postdoctoral Fellow Bentley Group, Computational Biology Lab Center for Vascular Biology Research, Beth Israel Deaconess Medical Center Harvard Medical School, Boston, MA web: http://www.kyleharrington.com On 10/19/15, 1:28 PM, "Saalfeld, Stephan" <[hidden email]> wrote: >Hi David, > >> (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display >>images on >> the screen, which is required to call "Images to Stack": >> >> (a)I want to open images in memory only and built the stack myself, >> example(s) [preferably kawa/clojure of course since I use kawa] >> welcome; >> >> (b)"Linear Stack Alignment with SIFT" does not expect/accept a stack >> argument, I would need, if possible, that you implement a version >> that accept a stack instead of 'magically' grab the one fiji creates >> when calling "Images to Stack" time: >> >> would that be possible? >> > >No, it is unnecessary because the ImageJ and mpicbg API have lots of >public methods that allow fine grained access to all its functionality. >You will have to read about and learn it and then you will realize that >both (1) and (2) are strange things to ask for ;). > >E.g., if you want to keep doing what you propose which is clearly the >result of not having spent sufficient time with it, you could call > >http://rsb.info.nih.gov/ij/developer/api/ij/IJ.html#run-ij.ImagePlus-java. >lang.String-java.lang.String- > >as making an ImagePlus from an ImageStack is as simple as > >http://rsb.info.nih.gov/ij/developer/api/ij/ImagePlus.html#ImagePlus-java. >lang.String-ij.ImageStack- > >and > >> As you understood already, it is extremely important for us, I should >>say mandatory >> actually, that absolutely everything happens in memory and no windows >>is/needs to >> be opened during the execution of the script. >> > >everything you're talking about happens in memory. If you do not want >UI, use the API directly instead of plugins whose sole purpose is to >provide a UI to some functions. > >Good luck, >Stephan > >-- >ImageJ mailing list: http://imagej.nih.gov/ij/list.html ________________________________ This message is intended for the use of the person(s) to whom it may be addressed. It may contain information that is privileged, confidential, or otherwise protected from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution, copying, or use of this information is prohibited. If you have received this message in error, please permanently delete it and immediately notify the sender. Thank you. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Saalfeld, Stephan
Dear all, but specially Stephan Saafeld,
I was particularly shocked with the tone of some of your answers to doubts posted regarding the mpcibg code. I always took for granted that the nicest part of ImageJ and FIJI is the sense of community and the fact that we can always help and be helped. Given the size and diversity of this community, it is evident that all kinds of doubts, from basic to sophisticated, will appear. Granted, some developers might not want or have the time to answer to the doubts regarding the code he/she developed. But if he/she is available to answer, sentences such as “ if you want to keep doing what you propose which is clearly the result of not having spent sufficient time with it ” seem impatient or aggressive, and serve not purpose. I don´t think we are part of part of this community to “teach lessons” (in the repressive sense) to others. We are here to help and promote free software, science and knowledge. Sincerely Prof. Sidnei Paciornik Grupo de Análise de Imagens e Microscopia Digital DEQM - Departamento de Engenharia Química e de Materiais PUC-Rio Rua Marquês de São Vicente 225 Prédio Leme, Sala 501L Gávea - Rio de Janeiro - RJ 22451-900 - Brasil tel: (55) (21)3527-1243 On Mon, Oct 19, 2015 at 3:28 PM, Saalfeld, Stephan < [hidden email] > wrote: Hi David, > (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display images on > the screen, which is required to call "Images to Stack": > > (a) I want to open images in memory only and built the stack myself, > example(s) [preferably kawa/clojure of course since I use kawa] > welcome; > > (b) "Linear Stack Alignment with SIFT" does not expect/accept a stack > argument, I would need, if possible, that you implement a version > that accept a stack instead of 'magically' grab the one fiji creates > when calling "Images to Stack" time: > > would that be possible? > No, it is unnecessary because the ImageJ and mpicbg API have lots of public methods that allow fine grained access to all its functionality. You will have to read about and learn it and then you will realize that both (1) and (2) are strange things to ask for ;). E.g., if you want to keep doing what you propose which is clearly the result of not having spent sufficient time with it, you could call http://rsb.info.nih.gov/ij/ developer/api/ij/IJ.html#run- ij.ImagePlus-java.lang.String- java.lang.String- as making an ImagePlus from an ImageStack is as simple as http://rsb.info.nih.gov/ij/ developer/api/ij/ImagePlus. html#ImagePlus-java.lang. String-ij.ImageStack- and > As you understood already, it is extremely important for us, I should say mandatory > actually, that absolutely everything happens in memory and no windows is/needs to > be opened during the execution of the script. > everything you're talking about happens in memory. If you do not want UI, use the API directly instead of plugins whose sole purpose is to provide a UI to some functions. Good luck, Stephan -- ImageJ mailing list: http://imagej.nih.gov/ij/list. html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Prof. Sidnei Paciornik,
thanks for your open criticism. I obviously fell victim to feeling offended by David's request "[...]I would need, if possible, that you implement a version that accept a stack instead of[...]" and responded with a snappy reply. That's inappropriate and I should have just shut up. Please consider in my defense that I had just answered David's initial question which had helped him go forward. Tone aside, I also explained the reasons for why I would not do what he asked me for and pointed to additional resources that would make him understand this and show him how to go forward. I like the ImageJ and Fiji community for it's helpful atmosphere and have contributed to this in the past, answering both beginners and advanced questions by explaining, posting code, examples, and references. I occasionally get pissed if I get the impression that somebody hijacks the helpful community to get their free lunch. I had this impression here, but you're right, it's not my business to judge and bitch around. Sorry for that, to David, you, and the rest of the community. Cheers, Stephan On Fri, 2015-10-23 at 16:16 +0000, Sidnei Paciornik wrote: > Dear all, but specially Stephan Saafeld, > I was particularly shocked with the tone of some of your answers to doubts > posted regarding the mpcibg code. > I always took for granted that the nicest part of ImageJ and FIJI is the sense > of community and the fact that we can always help and be helped. Given the size > and diversity of this community, it is evident that all kinds of doubts, from > basic to sophisticated, will appear. > Granted, some developers might not want or have the time to answer to the doubts > regarding the code he/she developed. But if he/she is available to answer, > sentences such as “ if you want to keep doing what you propose which is clearly the result of not having spent sufficient time with it ” seem impatient or aggressive, and serve not purpose. > I don´t think we are part of part of this community to “teach lessons” (in the > repressive sense) to others. We are here to help and promote free software, > science and knowledge. > Sincerely Prof. Sidnei Paciornik Grupo de Análise de Imagens e Microscopia Digital > DEQM - Departamento de Engenharia Química e de Materiais > PUC-Rio > > Rua Marquês de São Vicente 225 > Prédio Leme, Sala 501L > Gávea - Rio de Janeiro - RJ > 22451-900 - Brasil > tel: (55) (21)3527-1243 > > > On Mon, Oct 19, 2015 at 3:28 PM, Saalfeld, Stephan < [hidden email] > wrote: > Hi David, > > > (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display images > on > > the screen, which is required to call "Images to Stack": > > > > (a) I want to open images in memory only and built the stack myself, > > example(s) [preferably kawa/clojure of course since I use kawa] > > welcome; > > > > (b) "Linear Stack Alignment with SIFT" does not expect/accept a stack > > argument, I would need, if possible, that you implement a version > > that accept a stack instead of 'magically' grab the one fiji creates > > when calling "Images to Stack" time: > > > > would that be possible? > > > > No, it is unnecessary because the ImageJ and mpicbg API have lots of > public methods that allow fine grained access to all its functionality. > You will have to read about and learn it and then you will realize that > both (1) and (2) are strange things to ask for ;). > > E.g., if you want to keep doing what you propose which is clearly the > result of not having spent sufficient time with it, you could call > > http://rsb.info.nih.gov/ij/ developer/api/ij/IJ.html#run- > ij.ImagePlus-java.lang.String- java.lang.String- > > as making an ImagePlus from an ImageStack is as simple as > > http://rsb.info.nih.gov/ij/ developer/api/ij/ImagePlus. > html#ImagePlus-java.lang. String-ij.ImageStack- > > and > > > As you understood already, it is extremely important for us, I should say > mandatory > > actually, that absolutely everything happens in memory and no windows is/needs > to > > be opened during the execution of the script. > > > > everything you're talking about happens in memory. If you do not want > UI, use the API directly instead of plugins whose sole purpose is to > provide a UI to some functions. > > Good luck, > Stephan > > -- > 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 |
Dear Stephan,
I really appreciate your response and nice acceptance of the criticism. This is all for the better for the whole community. My best regards, Sidnei On Fri, Oct 23, 2015 at 5:25 PM, Saalfeld, Stephan < [hidden email] > wrote: Dear Prof. Sidnei Paciornik, thanks for your open criticism. I obviously fell victim to feeling offended by David's request "[...]I would need, if possible, that you implement a version that accept a stack instead of[...]" and responded with a snappy reply. That's inappropriate and I should have just shut up. Please consider in my defense that I had just answered David's initial question which had helped him go forward. Tone aside, I also explained the reasons for why I would not do what he asked me for and pointed to additional resources that would make him understand this and show him how to go forward. I like the ImageJ and Fiji community for it's helpful atmosphere and have contributed to this in the past, answering both beginners and advanced questions by explaining, posting code, examples, and references. I occasionally get pissed if I get the impression that somebody hijacks the helpful community to get their free lunch. I had this impression here, but you're right, it's not my business to judge and bitch around. Sorry for that, to David, you, and the rest of the community. Cheers, Stephan On Fri, 2015-10-23 at 16:16 +0000, Sidnei Paciornik wrote: > Dear all, but specially Stephan Saafeld, > I was particularly shocked with the tone of some of your answers to doubts > posted regarding the mpcibg code. > I always took for granted that the nicest part of ImageJ and FIJI is the sense > of community and the fact that we can always help and be helped. Given the size > and diversity of this community, it is evident that all kinds of doubts, from > basic to sophisticated, will appear. > Granted, some developers might not want or have the time to answer to the doubts > regarding the code he/she developed. But if he/she is available to answer, > sentences such as “ if you want to keep doing what you propose which is clearly the result of not having spent sufficient time with it ” seem impatient or aggressive, and serve not purpose. > I don´t think we are part of part of this community to “teach lessons” (in the > repressive sense) to others. We are here to help and promote free software, > science and knowledge. > Sincerely Prof. Sidnei Paciornik Grupo de Análise de Imagens e Microscopia Digital > DEQM - Departamento de Engenharia Química e de Materiais > PUC-Rio > > Rua Marquês de São Vicente 225 > Prédio Leme, Sala 501L > Gávea - Rio de Janeiro - RJ > 22451-900 - Brasil > tel: (55) (21)3527-1243 > > > On Mon, Oct 19, 2015 at 3:28 PM, Saalfeld, Stephan < [hidden email] > wrote: > Hi David, > > > (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display > on > > the screen, which is required to call "Images to Stack": > > > > (a) I want to open images in memory only and built the stack myself, > > example(s) [preferably kawa/clojure of course since I use kawa] > > welcome; > > > > (b) "Linear Stack Alignment with SIFT" does not expect/accept a stack > > argument, I would need, if possible, that you implement a version > > that accept a stack instead of 'magically' grab the one fiji creates > > when calling "Images to Stack" time: > > > > would that be possible? > > > > No, it is unnecessary because the ImageJ and mpicbg API have lots of > public methods that allow fine grained access to all its functionality. > You will have to read about and learn it and then you will realize that > both (1) and (2) are strange things to ask for ;). > > E.g., if you want to keep doing what you propose which is clearly the > result of not having spent sufficient time with it, you could call > > http://rsb.info.nih.gov/ij/ developer/api/ij/IJ.html#run- > ij.ImagePlus-java.lang.String- java.lang.String- > > as making an ImagePlus from an ImageStack is as simple as > > http://rsb.info.nih.gov/ij/ developer/api/ij/ImagePlus. > html#ImagePlus-java.lang. String-ij.ImageStack- > > and > > > As you understood already, it is extremely important for us, I should say > mandatory > > actually, that absolutely everything happens in memory and no windows > to > > be opened during the execution of the script. > > > > everything you're talking about happens in memory. If you do not want > UI, use the API directly instead of plugins whose sole purpose is to > provide a UI to some functions. > > Good luck, > Stephan > > -- > 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 |
In reply to this post by Saalfeld, Stephan
Hi Stephan,
Sorry for the long delay, but I had to jump on another project. As it has been said already, we are not here to fight, neither to judge, but to help each other. Your library is great, but as it is, I can't use it from scheme, see below for further explanation... Please reconsider, thanks! > > (1) "Linear Stack Alignment with SIFT" now works, _but_, iff I display images on > > the screen, which is required to call "Images to Stack": > > > > (a) I want to open images in memory only and built the stack > > myself, example(s) [preferably kawa/clojure of course since I use kawa] > > welcome; > > > > (b) "Linear Stack Alignment with SIFT" does not expect/accept a > > stack argument, I would need, if possible, that you implement a version > > that accept a stack instead of 'magically' grab the one fiji > > creates when calling "Images to Stack" time: > > > > would that be possible? > > > > No, it is unnecessary because the ImageJ and mpicbg API have lots of > public methods that allow fine grained access to all its functionality. library have, I still miss the 2 I need :) 1] ImagesToStack is the only way we can build a stack out of images of diff sizes. AFAICT, there is no other way: all "add slice" public methods require images to be of the same size, and otherwise raise a exception; ImagesToStack requires images to be displayed on the screen, which is less then optimal for scripting. Wrt the above, I now have written a scheme ij-images-to-stack procedure which implements, in scheme, the functionality provided by ImagesToStack except that it does not ask any image to be displayed on the screen. If someone is interested, ping me and I'll post the code 2] From scheme [Kawa in this case], even if I display the manually built stack on the screen, which is not what we want anyway, but I did try that in the mean time, then run "Linear Stack Alignment with SIFT", I can't get access to the result, because that UI 'run' functionality does not return a value [the new stack]; please understand that when I call 'run "Linear Stack Alignment with SIFT" ...' from scheme, the new stack, 'Aligned 1 of ...' is not displayed on the screen, unlike while using fiji, so I can't get access to the aligned images no matter what. The above is to explain and because I was trying to find a solution in the mean time, but I'm looking for scripting optimal solution, which as I said, does not require any display on the screen. So, Stephan, I really hope you will accept to reconsider and write a lower level public method LinearStackAlignmentWithSIFT stack paramstring -> which returns a stack Many thanks, David #|kawa:12|# (ij-run "Linear Stack Alignment with SIFT" "initial_gaussian_blur=1.60 steps_per_scale_octave=3 minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 maximal_alignment_error=25 inlier_ratio=0.05 expected_transformation=Translation interpolate") #|(---:13|# Processing SIFT ... took 3216ms. 2954 features extracted. Processing SIFT ... took 1562ms. 2395 features extracted. identifying correspondences using brute force ... took 1160ms 519 potentially corresponding features identified Done. -> #!null #|kawa:14|# ^^ Since the UI 'run' functionality does not return a value and since the aligned images ^^ stack is not displayed on the screen, I can't get access and save the result. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
In reply to this post by Kyle Harrington
Le Tue, 20 Oct 2015 17:12:50 +0000,
Hello Kyle, > FWIW, although I haven¹t gotten around to wrapping the SIFT alignment code > for concise Clojure access, if you have funimage installed (update site: > http://sites.imagej.net/Funimage/) you can do this in the Clojure > interpreter: Thanks, I looked at your code, cool! Cheers, David -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
In reply to this post by Saalfeld, Stephan
Hello,
Can anyone interested, including the original author of course, please send me a [reasonable] quote to patch the existing mpicbg library so it would have a public method, _not_ depending on UI, which would receive 2 args and return a new stack with the aligned images: LinearStackAlignmentWithSIFT stack paramstring -> which returns a new stack with the aligned images Many thanks, David (a) The actual implementation of/for "Linear Stack Alignment With SIFT" is missing a proper separation between the low level functionality and the GUI [it requires the stack of images to be aligned to be displayed on the screen and otherwise fails with the exception "No images open"]; (b) It is anyway unusable(*), from scheme I mean, and probably any host languages, because not only does it not return the new stack as a value, but for some mysterious reason(s), it does not display the new stack, so I currently have no way to 'grab' it. Here is a session fr the curious...: #|kawa:12|# (ij-run "Linear Stack Alignment with SIFT" "initial_gaussian_blur=1.60 steps_per_scale_octave=3 minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 maximal_alignment_error=25 inlier_ratio=0.05 expected_transformation=Translation interpolate") #|(---:13|# Processing SIFT ... took 3216ms. 2954 features extracted. Processing SIFT ... took 1562ms. 2395 features extracted. identifying correspondences using brute force ... took 1160ms 519 potentially corresponding features identified Done. -> #!null #|kawa:14|# ^^ Since the UI 'run' functionality does not return a value and since the aligned images ^^ stack is not displayed on the screen, I can't get access and save the results. (*) unfortunately because I would use it 'as is' in the mean time, despite for scripting but acceptable until solved ... -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
Don't use the macro way of invoking the plugin, but the direct java way
instead. According to the plugins.config: https://github.com/axtimwalde/mpicbg/blob/master/mpicbg_/src/main/resources/plugins.config ... the "Linear Stack Alignment with SIFT" command invokes the "SIFT_Align" class in SIFT_Align.java, which is here: https://github.com/axtimwalde/mpicbg/blob/master/mpicbg_/src/main/java/SIFT_Align.java ... and within SIFT_Align.run we see: https://github.com/axtimwalde/mpicbg/blob/master/mpicbg_/src/main/java/SIFT_Align.java#L130 ... that it asks for parameters in a dialog, extracts the features, then finds the matches (the correspondences across consecutive images) and then opens the resulting stack. Refactoring the "run" method is trivial: move everything after the dialog to a static method invoked with as many parameters as the dialog had. I am sure a pull request is welcome. Best, Albert 2015-12-01 12:11 GMT-05:00 David Pirotte <[hidden email]>: > Hello, > > Can anyone interested, including the original author of course, please > send me a > [reasonable] quote to patch the existing mpicbg library so it would have a > public > method, _not_ depending on UI, which would receive 2 args and return a new > stack > with the aligned images: > > LinearStackAlignmentWithSIFT > stack > paramstring > > -> which returns a new stack with the aligned images > > Many thanks, > David > > (a) The actual implementation of/for "Linear Stack Alignment With SIFT" is > missing a > proper separation between the low level functionality and the GUI [it > requires the > stack of images to be aligned to be displayed on the screen and otherwise > fails with > the exception "No images open"]; > > (b) It is anyway unusable(*), from scheme I mean, and probably any host > languages, > because not only does it not return the new stack as a value, but for some > mysterious reason(s), it does not display the new stack, so I currently > have no way > to 'grab' it. Here is a session fr the curious...: > > > #|kawa:12|# (ij-run "Linear Stack Alignment with SIFT" > "initial_gaussian_blur=1.60 steps_per_scale_octave=3 > minimum_image_size=64 maximum_image_size=1024 feature_descriptor_size=4 > feature_descriptor_orientation_bins=8 closest/next_closest_ratio=0.92 > maximal_alignment_error=25 inlier_ratio=0.05 > expected_transformation=Translation interpolate") > #|(---:13|# Processing SIFT ... > took 3216ms. > 2954 features extracted. > Processing SIFT ... > took 1562ms. > 2395 features extracted. > identifying correspondences using brute force ... took 1160ms > 519 potentially corresponding features identified > Done. > -> #!null > #|kawa:14|# > > ^^ Since the UI 'run' functionality does not return a value and since > the aligned images > ^^ stack is not displayed on the screen, I can't get access and save > the results. > > > (*) unfortunately because I would use it 'as is' in the mean time, > despite > for scripting but acceptable until solved ... > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- http://albert.rierol.net http://www.janelia.org/lab/cardona-lab http://www.ini.uzh.ch/~acardona/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hello Albert,
> Don't use the macro way of invoking the plugin, but the direct java way > instead. > ... Well, thanks, but as I did ask, I'm looking for someone to, and I'd rather have you [or another top notch java/imagej hacker] write the patch, so I hope you're are interested! > > LinearStackAlignmentWithSIFT > > stack > > paramstring > > > > -> which returns a new stack with the aligned images Would you be interested to implement the above? Do you have some available time in the very near future? Then please send me a quote to do this work. I am happy to hear that it would be absolutely trivial for you, which is exactly what I thought: for a good java/imagej hacker, a tiny patch. By 'this work', I mean absolutely everything that needs to be done, so that I just have to grab mpicbg-1.0.3.jar, import it in scheme, define an alias and use the method: (define-alias ij-linear-stack-alignment-with-sift ij.mpicbg:LinearStackAlignmentWithSIFT) [ or what ever class path:method name you choose of course ...] ... (j-linear-stack-alignment-with-sift istack "initial_gaussian_blur=1.60 ...") -> returns the new stack with the aligned images ... Happy Hacking, Sapristi! Many thanks, David -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html attachment0 (484 bytes) Download Attachment |
Free forum by Nabble | Edit this page |