Skip to content

Instantly share code, notes, and snippets.

@breuderink
Last active August 29, 2015 14:10
Show Gist options
  • Save breuderink/a572640f6b67869ba33f to your computer and use it in GitHub Desktop.
Save breuderink/a572640f6b67869ba33f to your computer and use it in GitHub Desktop.
myImporter = physioset.import.fieldtrip();
n0 = node.physioset_import.new('Importer', myImporter);
f = load('out.mat', 'raw_data')
data = run(n0, f.raw_data)
Warning: A new session was created in folder 'session_1'
> In session.session>session.instance at 79
In abstract_node.get_data_dir at 40
In abstract_node.get_full_dir at 36
In abstract_node.initialize at 35
In abstract_node.run at 88
In meeg at 17
Error using datahash.DataHash>CoreHash (line 319)
Java exception occurred:
java.lang.OutOfMemoryError: Java heap space
Error in datahash.DataHash>CoreHash (line 314)
Engine = CoreHash(Data{iS}, Engine);
Error in datahash.DataHash>CoreHash (line 308)
Engine = CoreHash(Data(iS).(F{iField}), Engine);
Error in datahash.DataHash (line 223)
Engine = CoreHash(Data, Engine);
Error in misc.var2name (line 23)
hash = DataHash(var);
Error in meegpipe.node.abstract_node/get_data_dir (line 41)
dataName = var2name(data);
Error in meegpipe.node.abstract_node/get_full_dir (line 36)
dataDir = get_data_dir(obj, data);
Error in meegpipe.node.abstract_node/initialize (line 35)
obj.RootDir_ = get_full_dir(obj, data);
Error in meegpipe.node.abstract_node/run (line 88)
initialize(obj, data);
Error in meeg (line 17)
data = run(n0, f.raw_data)
@germangh
Copy link

Can you do disp(f) and disp(f.raw_data) ? Is f.raw_data a Fieldtrip structure or just a (large) data matrix?

@germangh
Copy link

germangh commented Dec 4, 2014

The pipeline that you define here has only one node: a physioset_import node that uses a fieldtrip importer. The physioset_import node is very simple, it takes some input (what exactly depends on the importer type, in this case, the input should be a Fieldtrip structure) and produces a physioset object (the data structure used by meegpipe to store M/EEG data and all related meta-information). You can inspect what the physioset_import node is doing by editing its process method (same goes for every other node type):

edit meegpipe.node.physioset_import.physioset_import.process

The really important line is this one:

output_physioset = import(importer, your_input)

So: the only thing the physioset_import node is to use method import of the provider data importer to generate a physioset object from whatever input you are provider. You need to make sure that your_input is exactly the type of input that the corresponding importer is expecting. There is no really much error checking in meegpipe (at least not yet) so you need to go to the documentation of the corresponding importer and see what it expects:

https://github.com/meegpipe/meegpipe/tree/master/%2Bphysioset/%2Bimport

Unfortunately there is not specific docs on the fieldtrip importer, apart from saying that you should provide a "fieltrip structure in a .mat file". The problem with your code is that you are not providing that to the importer but something else. I suspect that f.raw_data is just a numeric matrix instead of a fieldtrip data matrix. Because that is not what the importer expects, its trying to do something that it shouldn't with it. From what I see in the error message it is trying to calculate hash of the matrix and the component that takes care of calculating the hash (which relies on Java) just can't handle such a large input and it crashes with an out-of-memory error.

Ask Ilse or Michele what I mean by "fieldtrip structure". I am sure they have the answer to this because they have done what you are trying to do many times.

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