Skip to content

Commit

Permalink
Text changes and validation mode
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl committed Oct 1, 2021
1 parent a5f6eb9 commit 4060f4d
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 12 deletions.
4 changes: 2 additions & 2 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const createMainWindow = () => {
preload: path.join(__dirname, 'preload.js'),
nativeWindowOpen: true,
},
width: 1000,
width: 1050,
height: 880,
minWidth: 1000,
minWidth: 1050,
minHeight: 880,
backgroundColor: '#094580',
});
Expand Down
2 changes: 1 addition & 1 deletion python/eeg2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def edf_to_bids_thread(data):
if 'edfData' not in data or 'files' not in data['edfData'] or not data['edfData']['files']:
error_messages.append('No .edf file(s) to convert.')
if 'bids_directory' not in data or not data['bids_directory']:
error_messages.append('The BIDS output directory is missing.')
error_messages.append('The BIDS output folder is missing.')
if not data['session']:
error_messages.append('The LORIS Visit Label is missing.')

Expand Down
1 change: 1 addition & 0 deletions src/css/Configuration.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ textarea {
}
.fa-question-circle {
color: #064785;
margin: 0 5px;
}
4 changes: 2 additions & 2 deletions src/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ body {
max-width: 175px;
}
.label {
width: 210px;
width: 240px;
display: inline-block;
max-width: 100%;
padding-right: 20px;
Expand All @@ -73,7 +73,7 @@ input {
}
.comboField {
display: inline-block;
max-width: calc(100% - 230px);
max-width: calc(100% - 260px);
vertical-align: top;
}
.alert {
Expand Down
49 changes: 48 additions & 1 deletion src/jsx/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ const Configuration = (props) => {
appContext.getFromTask('bidsDirectory'),
);
} else {
bidsDirectoryStatus = formatError('No BIDS output directory selected');
bidsDirectoryStatus = formatError('No BIDS output folder selected');
}
result.push(<div key='bidsDirectoryStatus'>{bidsDirectoryStatus}</div>);

Expand Down Expand Up @@ -1341,6 +1341,8 @@ const Configuration = (props) => {
label='EDF Recording to convert'
required={true}
onUserInput={onUserInput}
help='Filename(s) must be formatted correctly:
e.g. [subjectID]_[sessionLabel]_[taskName]_[run-1]_ieeg.edf'
/>
<div>
<small>
Expand All @@ -1355,6 +1357,7 @@ const Configuration = (props) => {
label='BIDS output folder'
placeholder={state.bidsDirectory.get}
onUserInput={onUserInput}
help='Where the BIDS-compliant folder will be created'
/>
</div>
<div className='small-pad'>
Expand All @@ -1368,6 +1371,7 @@ const Configuration = (props) => {
eeg: 'EEG',
}}
checked={state.modality.get}
help='If any intracranial (stereo) channels, select Stereo iEEG'
/>
</div>
<div className='small-pad'>
Expand All @@ -1381,6 +1385,8 @@ const Configuration = (props) => {
no: 'No',
}}
checked={state.LORIScompliant.get ? 'yes' : 'no'}
help='Select Yes if research datasets will be stored
in a LORIS data platform'
/>
</div>
</div>
Expand All @@ -1407,6 +1413,9 @@ const Configuration = (props) => {
}
label='Recording parameters (json)'
onUserInput={onUserInput}
help='Used to contribute non-required fields to *.json BIDS
parameter file. See BIDS spec and template available with
this release. Blank fields ignored.'
/>
</div>
<div className='small-pad'>
Expand All @@ -1421,6 +1430,8 @@ const Configuration = (props) => {
}
label='annotations.json'
onUserInput={onUserInput}
help='Labels for Annotations, compliant with BIDS spec.
One file per task/run. Filename must be formatted correctly.'
/>
</div>
</div>
Expand Down Expand Up @@ -1453,6 +1464,9 @@ const Configuration = (props) => {
}
label='annotations.tsv'
onUserInput={onUserInput}
help='Annotation data: time, label, etc compliant
with BIDS spec. One file per task/run.
Filename must be formatted correctly.'
/>
</div>
</div>
Expand All @@ -1469,6 +1483,8 @@ const Configuration = (props) => {
label='Task name'
value={state.taskName.get}
onUserInput={onUserInput}
help='Task, stimulus, state or experimental context.
See BIDS specification for more information.'
/>
</div>
{state.LORIScompliant.get &&
Expand All @@ -1477,6 +1493,10 @@ const Configuration = (props) => {
<label className="label" htmlFor='#siteID_API'>
<b>
Site <span className="red">*</span>
<i
className='fas fa-question-circle'
data-tip='Study Centre'
></i>
</b>
</label>
<div className='comboField'>
Expand Down Expand Up @@ -1504,6 +1524,10 @@ const Configuration = (props) => {
<label className="label" htmlFor='#projectID_API'>
<b>
Project <span className="red">*</span>
<i
className='fas fa-question-circle'
data-tip='Study'
></i>
</b>
</label>
<div className='comboField'>
Expand Down Expand Up @@ -1531,6 +1555,10 @@ const Configuration = (props) => {
<label className="label" htmlFor='#subprojectID_API'>
<b>
Subproject <span className="red">*</span>
<i
className='fas fa-question-circle'
data-tip='Subproject or population cohort'
></i>
</b>
</label>
<div className='comboField'>
Expand Down Expand Up @@ -1560,6 +1588,10 @@ const Configuration = (props) => {
<label className="label" htmlFor='#session_API'>
<b>
Session <span className="red">*</span>
<i
className='fas fa-question-circle'
data-tip='Visit or TimePoint Label'
></i>
</b>
{state.LORIScompliant.get &&
<div><small>(LORIS Visit Label)</small></div>
Expand Down Expand Up @@ -1598,6 +1630,7 @@ const Configuration = (props) => {
label='Reference'
value={state.reference.get}
onUserInput={onUserInput}
help='See BIDS specification for more information'
/>
</div>
<div className='small-pad'>
Expand All @@ -1607,6 +1640,7 @@ const Configuration = (props) => {
value={state.lineFreq.get}
placeholder='n/a'
onUserInput={onUserInput}
help='See BIDS specification for more information'
/>
</div>
<div className='small-pad'>
Expand All @@ -1621,6 +1655,7 @@ const Configuration = (props) => {
'epoched': 'Epoched',
}}
onUserInput={onUserInput}
help='See BIDS specification for more information'
/>
</div>
</div>
Expand Down Expand Up @@ -1648,6 +1683,8 @@ const Configuration = (props) => {
}
}
checked={state.participantEntryMode.get}
help='Specify participant details manually
or by lookup in LORIS'
/>
</div>
}
Expand Down Expand Up @@ -1678,6 +1715,7 @@ const Configuration = (props) => {
'other': 'Other',
}}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
<div className='small-pad'>
Expand All @@ -1692,6 +1730,7 @@ const Configuration = (props) => {
'A': 'Ambidextrous',
}}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
</>
Expand Down Expand Up @@ -1728,6 +1767,7 @@ const Configuration = (props) => {
'A': 'Ambidextrous',
}}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
</>
Expand All @@ -1741,6 +1781,7 @@ const Configuration = (props) => {
required={true}
value={state.participantID.get}
onUserInput={onUserInput}
help='Study ID (e.g. LORIS PSCID)'
/>
{state.LORIScompliant.get &&
<div><small>Use the LORIS PSCID</small></div>
Expand All @@ -1753,6 +1794,7 @@ const Configuration = (props) => {
placeholder='n/a'
value={state.participantAge.get}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
<div className='small-pad'>
Expand All @@ -1767,6 +1809,7 @@ const Configuration = (props) => {
'other': 'Other',
}}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
<div className='small-pad'>
Expand All @@ -1781,6 +1824,7 @@ const Configuration = (props) => {
'A': 'Ambidextrous',
}}
onUserInput={onUserInput}
help='Required; see BIDS specification for more information'
/>
</div>
</>
Expand Down Expand Up @@ -1949,6 +1993,8 @@ const Configuration = (props) => {
value={preparedBy}
placeholder='Enter your name'
onUserInput={(_, value) => setPreparedBy(value)}
help='Name of person performing data conversion
and validation is required.'
/>
{!preparedBy && displayErrors &&
<div>
Expand All @@ -1975,6 +2021,7 @@ const Configuration = (props) => {
>
{modalText.message[modalText.mode]}
</Modal>
<ReactTooltip/>
</>
);
} else {
Expand Down
9 changes: 8 additions & 1 deletion src/jsx/Validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ const Validator = (props) => {
}
}, [socketContext]);

useEffect(() => {
if (!appContext.getFromTask('output_time')) {
setValidationMode('folder');
} else {
setValidationMode('lastRun');
}
}, [props.visible]);
/**
* onMessage - received message from python.
* @param {object} message - response
Expand Down Expand Up @@ -208,7 +215,7 @@ const Validator = (props) => {
<DirectoryInput id='bidsDirectory'
name='bidsDirectory'
required={validationMode == 'folder'}
label='BIDS input folder'
label='BIDS folder'
placeholder={bidsDirectory}
onUserInput={(_, value) => setBidsDirectory(value)}
/>
Expand Down
Loading

0 comments on commit 4060f4d

Please sign in to comment.