[Mne_analysis] How to create report using MNE Report module?

balandongiv at gmail.com balandongiv at gmail.com
Fri Aug 7 09:50:32 EDT 2020
Search archives:

        External Email - Use Caution        

Hi All,

It is a great thing that mne has a feature for creating an HTML report.
However, I am having difficulty in applying the information provided from
the Getting started with mne.Report tutorial onto my real-life application.

In the tutorial, it seems that any figure generated needs to be appended.
But, upon completion, a figure of the plot_properties is outputted despite
it is enclosed within the figs.append(). Also, there is no HTML report
generated upon completion.

Also, may I know how to append additional information into the report.

The full code to reproduce the above scenario is given below.

Appreciate for any insight.

def generate_report(raw,filename, ica, ch_not_considered):

    report = Report(image_format='png', subject='try_sample_subject',

                    raw_psd=True)  # use False for speed here

    report.parse_folder(filename, on_error='ignore')

    figs = list()

    figs.append(ica.plot_components())

    figs.append(ica.plot_properties(raw, picks=[0]))

    # How to include additional text? say channel that ch_not_considered

    report.add_slider_to_section(figs, image_format='png')  # can also use
'svg'

    report.save('my_reportxx.html', overwrite=True)

 

 

def all_procedure():

    filename = r'S17_3.mff' # Accessible via:
https://drive.google.com/drive/folders/14R_2A-ceqOFvRkDZH6Skm4CqF5B-K7Co?usp
=sharing

    ch_not_considered = ['E128', 'E127', 'E126', 'E126', 'E48', 'E119',
'E17']

    raw = mne.io.read_raw_egi(filename, preload=True)

    raw.crop(0, 300)  # crop huge artifact at the end

    all_bad_ch = ['E128', 'E127', 'E126', 'E126', 'E48', 'E119', 'E17']

    raw.info['bads'] = all_bad_ch  # mark bad channels

    filt_raw = raw.copy()

    ica = ICA(n_components=5, random_state=97)

    ica.fit(filt_raw)

 

    generate_report(raw,filename, ica, ch_not_considered)

 

 

all_procedure()

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200807/e185593a/attachment.html 


More information about the Mne_analysis mailing list