<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-MY link="#0563C1" vlink="#954F72"><p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div class=WordSection1><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>Hi All,<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>It is a great thing that </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>mne</span><span style='mso-fareast-language:EN-MY'> has a feature for creating an HTML report.<br>However, I am having difficulty in applying the information provided from the </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>Getting started with mne.Report</span><span style='mso-fareast-language:EN-MY'> tutorial onto my real-life application.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>In the tutorial, it seems that any figure generated needs to be appended. But, upon completion, a figure of the </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>plot_properties</span><span style='mso-fareast-language:EN-MY'> is outputted despite it is enclosed within the </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>figs.append()</span><span style='mso-fareast-language:EN-MY'>. Also, there is no </span><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>HTML report</span><span style='mso-fareast-language:EN-MY'> generated upon completion.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>Also, may I know how to append additional information into the report.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>The full code to reproduce the above scenario is given below.<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='mso-fareast-language:EN-MY'>Appreciate for any insight.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>def generate_report(raw,filename, ica, ch_not_considered):<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp; &nbsp;report = Report(image_format='png', subject='try_sample_subject',<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raw_psd=True)&nbsp; # use False for speed here<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; report.parse_folder(filename, on_error='ignore')<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; figs = list()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; figs.append(ica.plot_components())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; figs.append(ica.plot_properties(raw, picks=[0]))<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; # How to include additional text? say channel that ch_not_considered<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; report.add_slider_to_section(figs, image_format='png')&nbsp; # can also use 'svg'<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; report.save('my_reportxx.html', overwrite=True)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>def all_procedure():<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; filename = r'S17_3.mff' # Accessible via: <a href="https://drive.google.com/drive/folders/14R_2A-ceqOFvRkDZH6Skm4CqF5B-K7Co?usp=sharing">https://drive.google.com/drive/folders/14R_2A-ceqOFvRkDZH6Skm4CqF5B-K7Co?usp=sharing</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; ch_not_considered = ['E128', 'E127', 'E126', 'E126', 'E48', 'E119', 'E17']<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; raw = mne.io.read_raw_egi(filename, preload=True)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; raw.crop(0, 300)&nbsp; # crop huge artifact at the end<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; all_bad_ch = ['E128', 'E127', 'E126', 'E126', 'E48', 'E119', 'E17']<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; raw.info['bads'] = all_bad_ch&nbsp; # mark bad channels<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; filt_raw = raw.copy()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; ica = ICA(n_components=5, random_state=97)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; ica.fit(filt_raw)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>&nbsp;&nbsp;&nbsp; generate_report(raw,filename, ica, ch_not_considered)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-MY'>all_procedure()<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>