Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulties with aa_downloaddemo.m #183

Closed
jpeelle opened this issue Jan 10, 2019 · 2 comments
Closed

Difficulties with aa_downloaddemo.m #183

jpeelle opened this issue Jan 10, 2019 · 2 comments

Comments

@jpeelle
Copy link
Member

jpeelle commented Jan 10, 2019

I'm having trouble understanding the logic in aa_downloaddemo.m. On line 24 and following it checks to see whether DEMODIRBASENAME (which is 'aa_demo') is in aap_directory_conventions.rawdatadir, and if not, generates an error:

sources = strsplit(aap.directory_conventions.rawdatadir,':')';
demoind = cell_index(sources, DEMODIRBASENAME);
assert(~any(demoind==0), ...
    ['did not find ''' DEMODIRBASENAME ''' directory in aap.directory_conventions.rawdatadir'])

so if I do something like this:

aap.directory_conventions.rawdatadir = '~/data';

I get an error. If I then do

aap.directory_conventions.rawdatadir = '~/data/aa_demo';

then the data downloads...BUT the script creates an 'aa_demo' folder as a subfolder of the rawdatadir, on line 33:

if ~exist('rawdir','var') || ~exist(fullfile(demodir,rawdir),'dir') % we need to download
    aas_makedir(aap,demodir);

the result is my data are in ~/data/aa_demo/aa_demo and the rest of the aa_user_demo script fails to run.

I may be missing something obvious about the logic here. What's the reason that 'aa_demo' is required to be in aap.directory_conventions.rawdatadir?

@tiborauer
Copy link
Member

The reason for aa_demo to allow automatic download into a central storage place shared within lab; so demo data is downloaded only once.

It is intentional (even if a little confusing) to have aa_demo/aa_demo. The first aa_demo is the name of the central store, while the second is actually the demo dataset. For BIDS114 it is aa_demo/ds114_test2.

Try using full path rather than "~".

@jpeelle
Copy link
Member Author

jpeelle commented Jan 11, 2019

Ah, I see now. I agree having the automatic download is excellent and it's an elegant script.

The other nonspecific error I reported has gone away.

I'm going to make a few modifications to aa_user_demo.m which I'm happy for feedback on, primarily adding more explanations in the comments (documenting all of the things I had to do in order to get the script to run).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants