Skip to content

Commit

Permalink
Phase 1 comments (from demo)
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Jun 22, 2021
1 parent 2d1e39a commit 21d715e
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
3 changes: 2 additions & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ const createMainWindow = () => {
minHeight: 880,
backgroundColor: '#094580',
});

mainWindow.removeMenu(); // Hides menu on Linux & Windows
// mainWindow.maximize();
mainWindow.show();

mainWindow.loadURL(startUrl).then(() => {
// if (process.env.DEV) mainWindow.webContents.openDevTools();
if (process.env.DEV) mainWindow.webContents.openDevTools();
});

mainWindow.on('closed', function() {
Expand Down
4 changes: 4 additions & 0 deletions public/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ contextBridge.exposeInMainWorld('myAPI', {
const {shell} = require('electron');
shell.openExternal('https://github.com/aces/eeg2bids');
},
visitMNE: () => {
const {shell} = require('electron');
shell.openExternal('https://mne.tools/mne-bids/');
},
visitMCIN: () => {
const {shell} = require('electron');
shell.openExternal('https://mcin.ca');
Expand Down
1 change: 0 additions & 1 deletion python/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .eeg2bids import *
14 changes: 4 additions & 10 deletions python/eeg2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ def edf_to_bids_thread(data):
error_messages.append('The file.edf to convert is missing.')
if not data['bids_directory']:
error_messages.append('The BIDS output directory is missing.')
if not data['events_tsv']:
error_messages.append('The events.tsv to include is missing.')
if not data['line_freq']:
error_messages.append('The line_freq is missing.')
if not data['site_id']:
error_messages.append('The LORIS SiteID is missing.')
if not data['project_id']:
Expand All @@ -82,6 +78,7 @@ def edf_to_bids_thread(data):
error_messages.append('The LORIS SubProjectID is missing.')
if not data['visit_label']:
error_messages.append('The LORIS Visit Label is missing.')

if not error_messages:
time = iEEG.Time()
data['output_time'] = 'output-' + time.latest_output
Expand All @@ -108,12 +105,9 @@ def edf_to_bids(sid, data):
# sub_project_id: '', visit_label: '', subject_id: ''}
print('edf_to_bids: ', data)
response = eventlet.tpool.execute(edf_to_bids_thread, data)
send = {
'output_time': response['output_time']
}
print('send received!')
print(send)
sio.emit('response', send)
print(response)
print('Response received!')
sio.emit('response', response.copy())


@sio.event
Expand Down
5 changes: 3 additions & 2 deletions src/css/SplashScreen.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
}
.loader-font {
top: 50%;
left: 50%;
text-align: center;
width: 100%;
color: #ffffff;
font-size: 24px;
position: fixed;
margin: -120px 0 0 -110px;
margin: -120px 0 0 0;
font-family: "Bangla MN", serif;
}
2 changes: 0 additions & 2 deletions src/css/Welcome.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
padding: 40px 20px 40px 20px;
color: #f6ffff;
background-color: #064785;
/*background-color: #039b83;*/
text-decoration: underline;
font-family: Verdana, sans-serif;
}
.font-large {
Expand Down
6 changes: 3 additions & 3 deletions src/jsx/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const Configuration = (props) => {
<div className={'small-pad'}>
<FileInput id='edfFile'
name='edfFile'
accept='.edf'
accept='.edf,.EDF'
placeholder={edfFile['name']}
label='File to convert (EDF format): '
onUserInput={onUserInput}
Expand All @@ -205,7 +205,7 @@ const Configuration = (props) => {
label='Data modality: '
onUserInput={onUserInput}
options={{
iEEG: 'iEEG',
iEEG: 'Stereo iEEG',
EEG: 'EEG',
}}
checked={edfType}
Expand Down Expand Up @@ -233,7 +233,7 @@ const Configuration = (props) => {
name='lineFreq'
label='Line frequency: '
value={lineFreq}
placeholder='Example: 60'
placeholder='n/a'
onUserInput={onUserInput}
/>
</div>
Expand Down
12 changes: 7 additions & 5 deletions src/jsx/Converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const Converter = (props) => {
socketContext.emit('edf_to_bids', {
file_path: appContext.getFromTask('edfFile') ?
appContext.getFromTask('edfFile').path : '',
modality: appContext.getFromTask('edfType') ?? '',
modality: appContext.getFromTask('edfType') ?? 'ieeg',
bids_directory: appContext.getFromTask('bidsDirectory') ?? '',
read_only: false,
events_tsv: appContext.getFromTask('eventsTSV') ?
appContext.getFromTask('eventsTSV').path : '',
line_freq: appContext.getFromTask('lineFreq') ?? '',
line_freq: appContext.getFromTask('lineFreq') ?? 'n/a',
site_id: appContext.getFromTask('siteID') ?? '',
project_id: appContext.getFromTask('projectID') ?? '',
sub_project_id: appContext.getFromTask('subProjectID') ?? '',
Expand Down Expand Up @@ -108,9 +108,11 @@ const Converter = (props) => {
});
} else {
setModalText((prevState) => {
prevState.message['error'] = <span key={'bids-errors'}
className={'bids-errors'}>
{message['error']}</span>;
prevState.message['error'] = (
<div key={'bids-errors'} className={'bids-errors'}>
{message['error'].map((error, i) => <p key={i}>{error}</p>)}
</div>
);
return {...prevState, ['mode']: 'error'};
});
}
Expand Down
16 changes: 14 additions & 2 deletions src/jsx/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ const Welcome = (props) => {
const myAPI = window['myAPI'];
myAPI.visitGitHub();
};
/**
* openMCIN - Navigate browser to MCIN.
*/
const openMNE = () => {
const myAPI = window['myAPI'];
myAPI.visitMNE();
};
/**
* openMCIN - Navigate browser to MCIN.
*/
Expand Down Expand Up @@ -90,8 +97,13 @@ const Welcome = (props) => {
{/*<input value={'Settings'} type={'button'} onClick={openSettings}/>*/}
</div>
<div className={'footer'}>
Powered by <a className={'open-source'} onClick={openGitHub}>
open source software</a>.<br/>
Powered by&nbsp;
<a className={'open-source'} onClick={openGitHub}>
open source software
</a> and&nbsp;
<a className={'open-source'} onClick={openMNE}>
MNE-BIDS
</a>.<br/>
Copyright © 2021 <a className={'mcin'} onClick={openMCIN}>
MCIN</a>.
</div>
Expand Down

0 comments on commit 21d715e

Please sign in to comment.