vferat/pycrostates

Roadmap to 0.1.0 release

Closed this issue · 0 comments

This issue can be used to reference items to complete before the first release (and OHBM):

General items:

  • [Not implemented] _BaseCluster should be part of the public API to allow for isinstance() calls but should not be part of the documentation (#24)
  • labels_ should be part of BaseCluster (#19)
  • labels_ should be affected by cluster_centers_ reordering (#19)

Cluster items (Base)

  • A fit should accept one of Raw | Epochs | ChData
  • A predict should accept one of Raw | Epochs | ChData
  • After fitting, a cluster instance should have the 4 attributes: .cluster_centers_, .info (instance of ChInfo), .fitted_data_, and .labels_ (#21)
  • cluster_centers_ should be provided as numpy arrays only (#21)
  • It should be possible to reorder/rename/pick channels from a cluster (impacting .cluster_centers_, .fitted_data_, and .labels_)
  • plot method to plot topographic maps of cluster_centers_ (#27)
  • save method for I/O. (#29)

New ChInfo class: similar to an MNE Info class but with no temporal information.

  • dict-like similar to Info (#21)
  • keys should include: chs, ch_names, .. (#21)
  • It should be possible to set and retrieve a montage. (#21)
  • [Not implemented] It should be possible to rename channels (but no reorder/pick). (#21)

New ChData class (or a better name!): used to hold preprocessed data. The preprocessing functions will return an instance of ChData which will hold a data array channels x samples with no temporal information/relation between the samples.

  • raw-like with a .info holding a ChInfo instance.
  • It should be possible to set and retrieve a montage.
  • It should be possible to rename/reorder/pick channels.
  • save method for I/O.

I/O operations: new module pycrostates.io

  • pycrostates.io.read_cluster to read a saved cluster instance. It should return a LoadedCluster instance that inherits from BaseCluster. (#29)
  • [Not implemented] A LoadedCluster instance can be instanciated with a cluster_centers_ array and a ChInfo info. Additionally, fitted_data and labels_ can be provided.
  • [Not implemented] A LoadedCluster instance should accept an MNE Info instance and convert it to a ChInfo instance.

Concatenation of cluster centers to re-fit a KMeans:

  • A function to concatenate instances of BaseCluster and return a ChData instance that can be re-used to fit a new cluster. The cluster centers from the different BaseCluster are concatenated and considered as new training samples.

Preprocessing

  • pycrostates.preprocessing.extract_gfp_peaks and pycrostates.preprocessing.resample should return ChData instance(s).

As much as possible, MNE Mixin should be used. Methods from a Mixin that should not be used have to be overwritten and should raise an AttributeError. Alternatively to overwriting the methods, the name can be intercepted in the hasattr special method and compared against a list of valid methods.