Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,43 @@ svg {
user-select: none;
}

.annotation.list-group-item {
.list-group-item {
position: relative;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}

.annotation {
background: #fffae6;
border-left: 5px solid #ff6600;
}

.epoch-details {
padding-right: 100px;
}

.epoch-action {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
position: absolute;
right: 0;
}

.epoch-tag {
padding: 5px;
background: #e7e4e4;
border-left: 5px solid #797878;
}

.epoch-tag p {
word-wrap: break-word;
width: 95%;
}

.event-list .btn.btn-primary {
color: #555;
border: 1px solid #555;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class DownloadPanel extends Component {
>Not Available</a>
: <a
className='btn btn-primary download col-xs-6'
href={this.state.outputType == 'derivative' &&
href={
(download.type ==
'physiological_annotation_files' ||
download.type == 'all_files') ?
Expand Down
288 changes: 149 additions & 139 deletions modules/electrophysiology_browser/jsx/electrophysiologySessionView.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ class ElectrophysiologySessionView extends Component {
chunksURL: null,
epochsURL: null,
electrodesURL: null,
events: null,
annotations: null,
splitData: null,
},
],
Expand Down Expand Up @@ -192,10 +194,10 @@ class ElectrophysiologySessionView extends Component {
}
return resp.json();
})
.then((data) => {
.then((data) => {
const database = data.database.map((dbEntry) => ({
...dbEntry,
// EEG Visualization parameters
// EEG Visualization urls
chunksURLs:
dbEntry
&& dbEntry.file.chunks_urls.map(
Expand All @@ -218,7 +220,10 @@ class ElectrophysiologySessionView extends Component {
&& loris.BaseURL
+ '/electrophysiology_browser/file_reader/?file='
+ group.links[1].file
),
),
events:
dbEntry
&& dbEntry.file.events,
annotations:
dbEntry
&& dbEntry.file.annotations,
Expand Down Expand Up @@ -305,13 +310,13 @@ class ElectrophysiologySessionView extends Component {
render() {
if (!this.state.isLoaded) {
return (
<button className='btn-info has-spinner'>
<button className='btn-info has-spinner'>
Loading
<span
className='glyphicon glyphicon-refresh glyphicon-refresh-animate'>
className='glyphicon glyphicon-refresh glyphicon-refresh-animate'>
</span>
</button>
);
</button>
);
}

if (this.state.isLoaded) {
Expand All @@ -320,153 +325,158 @@ class ElectrophysiologySessionView extends Component {
const {
chunksURLs,
epochsURL,
electrodesURL,
events,
annotations,
electrodesURL,
} = this.state.database[i];
const file = this.state.database[i].file;
const splitPagination = [];
for (const j of Array(file.splitData?.splitCount).keys()) {
splitPagination.push(
<a
key={j}
className={
'btn btn-xs btn-primary split-nav'
+ (file.splitData?.splitIndex === j ? ' active' : '')
}
onClick={() => this.getSplitData(file.id, i, j)}
>{j+1}</a>
);
<a
key={j}
className={
'btn btn-xs btn-primary split-nav'
+ (file.splitData?.splitIndex === j ? ' active' : '')
}
onClick={() => this.getSplitData(file.id, i, j)}
>{j+1}</a>
);
}
database.push(
<div key={i}>
<div key={i}>
<FilePanel
id={'filename_panel_' + i}
title={this.state.database[i].file.name}
data={this.state.database[i].file.details}
id={'filename_panel_' + i}
title={this.state.database[i].file.name}
data={this.state.database[i].file.details}
>
<div className="react-series-data-viewer-scoped col-xs-12">
<EEGLabSeriesProvider
chunksURL={
chunksURLs?.[file.splitData?.splitIndex] || chunksURLs
}
epochsURL={epochsURL}
electrodesURL={electrodesURL}
<div className="react-series-data-viewer-scoped col-xs-12">
<EEGLabSeriesProvider
chunksURL={
chunksURLs?.[file.splitData?.splitIndex] || chunksURLs
}
epochsURL={epochsURL}
events={events}
annotations={annotations}
>
<Panel
id='channel-viewer'
title={
'Signal Viewer' + (file.splitData
? ' [split '+(file.splitData?.splitIndex+1)+']'
: ''
)
}
>
{file.splitData &&
<>
<span
style={{
color: '#064785',
fontWeight: 'bold',
fontSize: '14px',
paddingRight: '15px',
}}
>
Viewing signal split file:
</span>
<a
className={
'btn btn-xs btn-default split-nav'
+ (file.splitData.splitIndex === 0
? ' disabled'
: '')
}
onClick={() => this.getSplitData(
file.id,
i,
file.splitData.splitIndex-1
)}
>
{'<'}
</a>
{splitPagination}
<a
className={
'btn btn-xs btn-default split-nav'
+ (file.splitData.splitIndex
=== (file.splitData.splitCount-1)
? ' disabled'
: '')
}
onClick={
() => this.getSplitData(
file.id,
i,
file.splitData.splitIndex+1
)
}
>
{'>'}
</a>
</>
}
<SeriesRenderer />
</Panel>
<div className='row'>
<div className='col-md-6 col-lg-4'>
<SummaryPanel
id={'filename_summary_' + i}
data={this.state.database[i].file.summary}
/>
</div>
<EEGMontage />
<div className='col-md-6 col-lg-4'>
<DownloadPanel
id={'file_download_' + i}
downloads={this.state.database[i].file.downloads}
physioFileID={this.state.database[i].file.id}
outputType={this.state.database[i].file.output_type}
/>
</div>
</div>
</EEGLabSeriesProvider>
</div>
</FilePanel>
</div>
);
electrodesURL={electrodesURL}
>
<Panel
id='channel-viewer'
title={
'Signal Viewer' + (file.splitData
? ' [split '+(file.splitData?.splitIndex+1)+']'
: ''
)
}
>
{file.splitData &&
<>
<span
style={{
color: '#064785',
fontWeight: 'bold',
fontSize: '14px',
paddingRight: '15px',
}}
>
Viewing signal split file:
</span>
<a
className={
'btn btn-xs btn-default split-nav'
+ (file.splitData.splitIndex === 0
? ' disabled'
: '')
}
onClick={() => this.getSplitData(
file.id,
i,
file.splitData.splitIndex-1
)}
>
{'<'}
</a>
{splitPagination}
<a
className={
'btn btn-xs btn-default split-nav'
+ (file.splitData.splitIndex
=== (file.splitData.splitCount-1)
? ' disabled'
: '')
}
onClick={
() => this.getSplitData(
file.id,
i,
file.splitData.splitIndex+1
)
}
>
{'>'}
</a>
</>
}
<SeriesRenderer
physioFileID={this.state.database[i].file.id}
annotationMetadata={annotations}
/>
</Panel>
<div className='row'>
<div className='col-md-6 col-lg-4'>
<SummaryPanel
id={'filename_summary_' + i}
data={this.state.database[i].file.summary}
/>
</div>
<EEGMontage />
<div className='col-md-6 col-lg-4'>
<DownloadPanel
id={'file_download_' + i}
downloads={this.state.database[i].file.downloads}
physioFileID={this.state.database[i].file.id}
outputType={this.state.database[i].file.output_type}
/>
</div>
</div>
</EEGLabSeriesProvider>
</div>
</FilePanel>
</div>
);
}

return (
<div id='lorisworkspace'>
<div id='lorisworkspace'>
<StaticDataTable
Headers={[
'PSCID',
'DCCID',
'Visit Label',
'Site',
'DOB',
'Sex',
'Output Type',
'Cohort',
]}
Data={[
[
this.state.patient.info.pscid,
this.state.patient.info.dccid,
this.state.patient.info.visit_label,
this.state.patient.info.site,
this.state.patient.info.dob,
this.state.patient.info.sex,
this.state.patient.info.output_type,
this.state.patient.info.cohort,
],
]}
freezeColumn='PSCID'
Hide={{rowsPerPage: true, downloadCSV: true, defaultColumn: true}}
/>
{database}
</div>
);
Headers={[
'PSCID',
'DCCID',
'Visit Label',
'Site',
'DOB',
'Sex',
'Output Type',
'Cohort',
]}
Data={[
[
this.state.patient.info.pscid,
this.state.patient.info.dccid,
this.state.patient.info.visit_label,
this.state.patient.info.site,
this.state.patient.info.dob,
this.state.patient.info.sex,
this.state.patient.info.output_type,
this.state.patient.info.cohort,
],
]}
freezeColumn='PSCID'
Hide={{rowsPerPage: true, downloadCSV: true, defaultColumn: true}}
/>
{database}
</div>
);
}
}
}
Expand Down
Loading