-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87a04e0
commit 5f5672d
Showing
7 changed files
with
172 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import View from '../view'; | ||
import ImageModel from '../models/ImageModel'; | ||
import SegmentationCollection from '../collections/SegmentationCollection'; | ||
import {SegmentationImageViewerWidget} from '../common/Viewer/ImageViewerWidget'; | ||
|
||
import SegmentationTaskTemplate from './segmentationTask.pug'; | ||
import './segmentationTask.styl'; | ||
|
||
import DetailSegmentationTaskTemplate from './detailSegmentationTask.pug'; | ||
|
||
|
||
var SegmentationTaskView = View.extend({ | ||
initialize: function (settings) { | ||
this.image = new ImageModel({ | ||
_id: '581cd7319fc3c13dcd0e1ed6' | ||
}); | ||
this.image | ||
.once('g:fetched', () => { | ||
this.segmentations = new SegmentationCollection(); | ||
this.segmentations | ||
.once('g:changed', () => { | ||
this.segmentation = this.segmentations.at(0); | ||
g_segmentation = this.segmentation; | ||
|
||
this.render(); | ||
}) | ||
.fetch({ | ||
imageId: this.image.id, | ||
limit: 0 | ||
}); | ||
}) | ||
.fetch(); | ||
|
||
// if (girder.currentUser.getSegmentationSkill() !== null) { | ||
// this.segmentationTasks = new TaskCollection(); | ||
// this.segmentationTasks.altUrl = 'task/me/segmentation'; | ||
// this.segmentationTasks.pageLimit = Number.MAX_SAFE_INTEGER; | ||
// | ||
// this.taskSegmentationView = new TasksGroupView({ | ||
// title: 'Lesion Segmentation', | ||
// subtitle: 'Segment boundaries between lesion and normal skin', | ||
// linkPrefix: girder.apiRoot + '/task/me/segmentation/redirect?datasetId=', | ||
// resourceName: 'dataset', | ||
// collection: this.segmentationTasks, | ||
// parentView: this | ||
// }); | ||
// } | ||
// this.render(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(SegmentationTaskTemplate({ | ||
segmentations: this.segmentations.models, | ||
formatDate: this.formatDate | ||
})); | ||
|
||
this.imageViewerWidget = new SegmentationImageViewerWidget({ | ||
el: this.$('.isic-segmentation-task-viewer'), | ||
model: this.image, | ||
parentView: this | ||
}).render(); | ||
|
||
this.imageViewerWidget.on('loaded', () => { | ||
this.imageViewerWidget.addSegmentation(this.segmentation); | ||
}); | ||
|
||
return this; | ||
} | ||
}); | ||
|
||
var DetailSegmentationTaskView = View.extend({ | ||
events: { | ||
|
||
}, | ||
|
||
initialize: function (settings) { | ||
this.segmentation = settings.segmentation; | ||
|
||
this.segmentation | ||
.once('g:fetched', () => { | ||
this.render(); | ||
}) | ||
.fetch(); | ||
}, | ||
|
||
render: function () { | ||
this.$el.html(DetailSegmentationTaskTemplate({ | ||
segmentation: this.segmentation, | ||
formatDate: this.formatDate | ||
})); | ||
return this; | ||
} | ||
}); | ||
|
||
export default SegmentationTaskView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
h1= segmentation.id | ||
span Created: #{formatDate(segmentation.get('created'))} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.container-fluid | ||
.row | ||
.col-sm-3 | ||
.isic-listing-container | ||
each segmentation, index in segmentations | ||
.isic-listing-panel-group.panel-group(id=`panel-group-${segmentation.id}`) | ||
.isic-listing-panel.panel.panel-default | ||
.isic-listing-panel-heading.panel-heading( | ||
data-toggle='collapse', | ||
data-parent=`panel-group-${segmentation.id}`, | ||
data-target=`panel-${segmentation.id}`) | ||
a.collapsed | ||
block heading | ||
= segmentation.id | ||
span.isic-listing-panel-heading-indicator.pull-right | ||
i.icon-right-open | ||
.isic-listing-panel-collapse.panel-collapse.collapse( | ||
id=`panel-${segmentation.id}`, | ||
data-model-index=index) | ||
.isic-listing-panel-body.panel-body | ||
span Created: #{formatDate(segmentation.get('created'))} | ||
|
||
.col-sm-9 | ||
.isic-segmentation-task-viewer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.isic-segmentation-task-viewer | ||
height 100vh | ||
width 100% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters