Comments (12)
I agree with all what you said. Basically you have 3 options:
- concat Raw instances and work at the raw level
- concat Epochs and return a new Epochs
- concat Epochs into a new object on with we can iterate and call average
and get_data. The concat magic would happen when accessing the data
wdyt?
from mne-python.
I like options 1 and 2 potentially better than option 3 (new object), because part of the motivation behind this is to continue to have access to all enhancements brought to the Epochs objects. That is, unless the new object (MultiEpochs or whatever) would inherit the Epochs class and just overload the average() and get_data() functions (and in this sense, be transparent to the user as otherwise being of the Epochs class)?
from mne-python.
I like options 1 and 2 potentially better than option 3 (new object),
because part of the motivation behind this is to continue to have access to
all enhancements brought to the Epochs objects. That is, unless the new
object (MultiEpochs or whatever) would inherit the Epochs class and just
overload the average() and get_data() functions (and in this sense, be
transparent to the user as otherwise being of the Epochs class)?
yes that would work. I'd say I'd have to try to implement it and use
it to see if it actually flies...
do not hesitate to give it a try as you clearly understood the
implications of those changes.
from mne-python.
I'll probably give the overloading a shot first, as this should be the easiest way not to require people to preload all their data.
from mne-python.
+1 for this.
My guess would be that 2) is the most clear / straight-forward option.
One option would be to include a .concatenate method for the epochs,
another one could be to do to override the add operator.
I personally hold a slight preference for a method or a function, as this
seems to involve less magic (although theres definitely something charming
to 'epochs_a + epochs_b').
2012/9/26 Eric89GXL [email protected]
I'll probably give the overloading a shot first, as this should be the
easiest way not to require people to preload all their data.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/120#issuecomment-8897627.
from mne-python.
Well, I just spent an embarrassing amount of time on this today to figure out that there's a problem with creating a new class (e.g., MultiClass) that inherits and extends the Epoch class. We'd either need to use a bunch of deepcopy()'s, or warn users against using it in certain ways.
In any case, I think it'll be cleaner to refactor the current Epochs class to use either 1) one raw input and one list of events (current behavior), or 2) a list of raws with a list of events (extended, new behavior). This will not only be easier to use than making a new class, but it easily retains backward compatibility, makes for a natural extension with a concatenate() call, and doesn't require people learning a new class. I'm going to work on that tomorrow.
from mne-python.
On 27.09.2012, at 01:31, Eric89GXL [email protected] wrote:
Well, I just spent an embarrassing amount of time on this today to figure out that there's a problem with creating a new class (e.g., MultiClass) that inherits and extends the Epoch class. We'd either need to use a bunch of deepcopy()'s, or warn users against using it in certain ways.
Ok, this does not sound ideal.. :-(
In any case, I think it'll be cleaner to refactor the current Epochs class to use either 1) one raw input and one list of events (current behavior), or 2) a list of raws with a list of events (extended, new behavior). This will not only be easier to use than making a new class, but it easily retains backward compatibility, makes for a natural extension with a concatenate() call, and doesn't require people learning a new class. I'm going to work on that tomorrow.
Sounds very good to me. And certainly getting into mixing classes and deepcopying nested structures is not exactly desirable.. (at least i don't like it)
Just free-wheeling: Maybe another take could be the use of class methods with alternative constructors and .new vs from_raws methods or so.
But probably it would be the most clean thing, as you say, to take the constructor as is and make its behavior contingent upon its input arguments, that is raw object vs list of raw objects.
—
Reply to this email directly or view it on GitHub.
from mne-python.
Well, I just spent an embarrassing amount of time on this today to figure
out that there's a problem with creating a new class (e.g., MultiClass) that
inherits and extends the Epoch class. We'd either need to use a bunch of
deepcopy()'s, or warn users against using it in certain ways.
that's what I was afraid of.
In any case, I think it'll be cleaner to refactor the current Epochs class
to use either 1) one raw input and one list of events (current behavior), or
2) a list of raws with a list of events (extended, new behavior). This will
not only be easier to use than making a new class, but it easily retains
backward compatibility, makes for a natural extension with a concatenate()
call, and doesn't require people learning a new class. I'm going to work on
that tomorrow.
sounds very reasonable and cleaner. What I've been willing to do too is to
instantiate a Raw with a list of fif files in case the run is too long.
A
from mne-python.
On 27.09.2012, at 09:24, Alexandre Gramfort [email protected] wrote:
Well, I just spent an embarrassing amount of time on this today to figure
out that there's a problem with creating a new class (e.g., MultiClass) that
inherits and extends the Epoch class. We'd either need to use a bunch of
deepcopy()'s, or warn users against using it in certain ways.that's what I was afraid of.
In any case, I think it'll be cleaner to refactor the current Epochs class
to use either 1) one raw input and one list of events (current behavior), or
2) a list of raws with a list of events (extended, new behavior). This will
not only be easier to use than making a new class, but it easily retains
backward compatibility, makes for a natural extension with a concatenate()
call, and doesn't require people learning a new class. I'm going to work on
that tomorrow.sounds very reasonable and cleaner. What I've been willing to do too is to
instantiate a Raw with a list of fif files in case the run is too long.A
... so one could search through all of them for events and instantiate an epochs object with more or less the existing code...
Bu how would the raw object then look like, e.g. The info structure?
—
Reply to this email directly or view it on GitHub.
from mne-python.
Bu how would the raw object then look like, e.g. The info structure?
the info should be exactly the same. That's valid if it's actually the same run.
from mne-python.
Then maybe this should be the way to go. Maybe other use cases will emerge and then we're best off with a Raw object that handles multiple fif files if desired.
On 27.09.2012, at 09:51, Alexandre Gramfort [email protected] wrote:
Bu how would the raw object then look like, e.g. The info structure?
the info should be exactly the same. That's valid if it's actually the same run.
—
Reply to this email directly or view it on GitHub.
from mne-python.
Then maybe this should be the way to go. Maybe other use cases will emerge
and then we're best off with a Raw object that handles multiple fif files if
desired.
I think we need both as the multiple fif input to raw should assume
that first_samp or the next is last_samp from the previous.
from mne-python.
Related Issues (20)
- Building the MNE doc fails with Python 3.12 and 3.11 (?) HOT 5
- _extract_sampling_rate function for io.read_raw_snirf incorrectly estimates sample rate due to floating point error. HOT 3
- BUG: EpochsTFR bug popping up in MNE-BIDS-Pipeline HOT 1
- Read_raw_eyelink failure: missing headpos data in file HOT 4
- GDF reader bug HOT 6
- raw.compute_psd("multitaper", ...) on a raw with "bad_xxx" annotations yields all np.nan HOT 1
- BUG: EDF export failing on latest edfio HOT 3
- mne.time_frequency.read_tfrs() did not work correctly when MNE.Raw.compute_tfr(method='multitaper', output='phase') HOT 1
- Complete uninstall documentation missing HOT 3
- set_annotations changes key:value mapping in event_id dict HOT 5
- Be more explicit about what is returned by read_epochs_eeglab and read_epochs_kit HOT 3
- Unicode support in the method add.text() of mne.viz.brain HOT 1
- Can't download the fsaverage data by mne.datasets.fetch_fsaverage(verbose=0) HOT 3
- Bad channels do not show up at all in `raw.plot()` HOT 4
- Mouse Offset in Brain Plot HOT 14
- Incorrect rendering of embedded HTML title (?) HOT 4
- Layout issues in documentation (horizontal navbar) HOT 26
- Add SOUND and SSP-SIR algorithms HOT 3
- Cannot build docs HOT 8
- Customize website color palette HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mne-python.