"Official" way to use third-party tools? #253
|
Hello. I'm getting ready to open a PR for our denoising tools. Question: My code uses rWLS, Wavelet toolbox (WDS), and AROMA. I downloaded rWLS and WDS someplace convenient on my machine and addpath to them. My AROMA module assumes AROMA lives in aap.directory_conventions_fsldir/bin/ICA-AROMA. It all works, but are these acceptable solutions? Or is there an official way to install third-party stuff for use with aa? Thanks much, |
Replies: 13 comments 2 replies
|
Since ICA-AROMA seems to be a binary and part of FSL, you do not really have to integrate (i.e. add to MATLAB path). However, you should use rWLS and WDS, on the other hand, requires handling from within MATLAB (add to MATLAB path); therefore, they should be integrated via the toolbox framework (each toolbox separately):
|
|
Counter-offer: I PR my code as-is and you modify it to conform to the new interface. That would really help us out on this. I suspect this would take you about a half hour. It would take me a month. |
|
You think a bit too highly of me :), and I am afraid I will not have time for that. I also do not think it is a sustainable development model. The question is whether you consider the toolbox framework a good solution. If yes, then it may be worth your time to invest now. If not, you may need to propose an alternative solution. |
|
The main difficulty is I can find no documentation on writing an aa class interface. Is there any? Perhaps I am looking in the wrong place. Since you have made the toolbox framework a prerequisite for aa development, you are obligated to provide such documentation. The alternative is spending a month stepping though the toolbox code trying to figure out what it's supposed to do. I also do not think this is a sustainable development model. |
|
You are absolutely right! We need proper documentation, and not only for the toolbox framework. This discussion goes beyond the current issue, and I am not even sure whether there is any answer for that apart from dedicated funding for open-source development. More importantly, I certainly do not have the bandwidth to provide documentation for everything I ever did with aa. Maybe if I had a different job. :) You asked me about the "official" way to use third-party tools, and my "two cent" is the toolbox interface - even though it is still under construction (esp. in terms of documentation). Apart from (or before) that, there is/was nothing, which I strongly oppose. To provide an answer to your issue, at least, you either hold your PR until the toolbox interface is properly documented so that you feel confident implementing it, or you submit your PR now and extend it later. However, I would like to avoid "officially" encouraging different practices. |
|
I don't disagree with anything you wrote, but it still leaves me with no solution. Our lab just finished a study that uses my new code, we can't submit our paper until my PR goes in, and my PR can't go in until rWLS and WDS get a class interface. I'll run this past the boss and see what he wants to do. |
|
There are multiple solutions:
|
|
I have added some documentation for the toolbox framework to the website and updated the core concepts accordingly. The same documentation will also be added to the toolboxes to keep it close to the code. Please, take a look and let me know whether you find it instructive enough. N.B.: It will also require a corresponding PR from me to work. I will submit it soon. |
|
Thanks much. I'll have a look... |
|
Quick question: I'm looking at wavelet despiking (it's one of the few SPM toolboxes I'm familiar with). aamod_waveletdespike.m has a call to aas_cache_get at the top, suggesting the module has been modified to conform to the new toolbox interface. However, I don't see a class interface file for wavelet despiking in aa_tools/toolboxes. Is this an omission or are there some toolboxes that don't require a class interface? |
|
Ok, I have "toolboxerized" the BrainWavelet toolbox. My updated code runs without crashing but let me list the changes I made here and you can let me know if I did anything horrific.
3a) I added a wds toolbox entry to my parameter file: 3b) I removed the old BrainWavelet toolbox parameter file entry:
lines 146-158 DELETED: and lines 232-238 DELETED: I think that's all. Here's the complete classDef file listing: |
|
Matlab appears to require an extraparameters field appear in each toolbox entry, otherwise aa_init crashes on this: Is there something you would recommend to replace doKeepInPath? |
|
I find it odd, however, you can keep the fied empty, as well: <extraparameters></extraparameters>It is also possible that this bug has been fixed by #255 only. |
Ok, I have "toolboxerized" the BrainWavelet toolbox. My updated code runs without crashing but let me list the changes I made here and you can let me know if I did anything horrific.
I added wdsClass.m -- I called the class wds (waveletdespiking) and it's mostly just fwsClass with a name change and a addpath(genpath()) to pick up nested mfiles. (I'll include the code listing at the end so it makes my list easier to read)
I load the toolbox on entry to aamod_waveletdespike.m (which also loads spm) and unload on exit: