Skip to content

Commit 3e724cf

Browse files
author
George
committed
gui update. Diable viewer for NA modalities. Adjust ranges for sliders
1 parent 3c07a2f commit 3e724cf

File tree

1 file changed

+38
-18
lines changed

1 file changed

+38
-18
lines changed

static/js/image_search.js

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ require([
9797
};
9898

9999
window.setSlider = function (slideDiv, reset, strt, end, isInt, updateNow) {
100+
parStr=$('#'+slideDiv).data("attr-par");
101+
if (parStr.startsWith('tcga_clinical') && !(reset)){
102+
checkTcga();
103+
}
100104
//var slideDiv = divName + "_slide";
101105
var max = $('#' + slideDiv).slider("option", "max");
102106

@@ -137,16 +141,18 @@ require([
137141
if (reset) {
138142
if ( (window.filterObj.hasOwnProperty(filtAtt)) && (window.filterObj[filtAtt].hasOwnProperty('rng')) ) {
139143
delete window.filterObj[filtAtt]['rng'];
140-
if (!( 'none' in window.filterObj[filtAtt])){
144+
if ( 'none' in window.filterObj[filtAtt]){
145+
window.filterObj[filtAtt]['type']='none';
146+
}
147+
else{
141148
delete window.filterObj[filtAtt];
142149
}
143150
}
144151
} else {
145152
var attVal = [];
146153
if (isInt) {
147154
attVal = [parseInt(strt), parseInt(end)];
148-
// edge effect
149-
attVal = [parseInt(strt), parseInt(end) ];
155+
150156
} else {
151157
attVal = [parseFloat(strt), parseFloat(end)];
152158
}
@@ -155,11 +161,11 @@ require([
155161
window.filterObj[filtAtt] = new Object();
156162
}
157163
window.filterObj[filtAtt]['rng'] = attVal;
158-
if (end<max){
159-
window.filterObj[filtAtt]['type']='lte';
164+
if (end<max) {
165+
window.filterObj[filtAtt]['type'] = 'ebtw';
160166
}
161167
else{
162-
window.filterObj[filtAtt]['type']='btw';
168+
window.filterObj[filtAtt]['type'] = 'ebtwe';
163169
}
164170
}
165171

@@ -442,6 +448,7 @@ require([
442448
if (elem.checked){
443449
if (!(id in window.filterObj)) {
444450
window.filterObj[id] = new Array();
451+
window.filterObj[id]['type']='none';
445452
}
446453
window.filterObj[id]['none'] = true;_
447454
}
@@ -592,11 +599,11 @@ require([
592599
var filtName = nm.join('.') + '_rng';
593600
//var filtName = nm;
594601

595-
$('#' + divName).append('<div id="' + slideName + '"></div> <input id="' + inpName + '" type="text" value="' + strtInp + '" style="display:none"> <button class="reset"" style="display:block;margin-top:18px" onclick=\'setSlider("' + slideName + '",true,0,0,' + String(isInt) + ', true)\'>Clear Slider</button>');
602+
$('#' + divName).append('<div id="' + slideName + '" data-attr-par="'+parStr+'"></div> <input id="' + inpName + '" type="text" value="' + strtInp + '" style="display:none"> <button class="reset"" style="display:block;margin-top:18px" onclick=\'setSlider("' + slideName + '",true,0,0,' + String(isInt) + ', true,"'+parStr+'")\'>Clear Slider</button>');
596603
$('#'+slideName).append(labelMin);
597604

598605
if (wNone){
599-
$('#' + divName).append( '<input type="checkbox" data-attr-par="'+parStr+'" class="noneBut" onchange="addNone(this, \''+parStr+'\', true)"> None' );
606+
$('#' + divName).append( '<input type="checkbox" class="noneBut" onchange="addNone(this, \''+parStr+'\', true)"> None' );
600607
}
601608

602609

@@ -917,9 +924,10 @@ require([
917924
}
918925
curFilterObj.collection_id = projectIdArr;
919926

927+
//curFilterObj={"Diameter_btw":[51,'*']}
920928

921929
var filterStr = JSON.stringify(curFilterObj);
922-
var fields = ["collection_id", "PatientID", "StudyInstanceUID", "StudyDescription", "StudyDate"];
930+
var fields = ["Diameter","collection_id", "PatientID", "StudyInstanceUID", "StudyDescription", "StudyDate"];
923931
var collapse_on = 'StudyInstanceUID'
924932
var order_docs = ["collection_id", "PatientID", "StudyInstanceUID"];
925933
if (isSeries) {
@@ -970,7 +978,7 @@ require([
970978
'<td class="col1 modality">' + modality + '</td>' +
971979
'<td class="col1 body-part-examined">' + bodyPartExamined + '</td>' +
972980
'<td class="series-description">' + seriesDescription + '</td>';
973-
if ((modality ==='SEG') || (modality ==='RTSTRUCT')){
981+
if ((modality ==='SEG') || (modality ==='RTSTRUCT') || (modality==='RTPLAN' ) || (modality==='RWV' ) ){
974982
newHtml += '<td class="ohif open-viewer"><a href="/" onclick="return false;"><i class="fa fa-eye-slash no-viewer-tooltip"></i></td></tr>';
975983

976984
}
@@ -1420,7 +1428,12 @@ require([
14201428
nmA = ckey.split('.');
14211429
nm=nmA[nmA.length-1];
14221430
if (nm.endsWith('_rng')){
1423-
1431+
if (window.filterObj[ckey].type==='none'){
1432+
nm=nm.replace('_rng','');
1433+
}
1434+
else {
1435+
nm = nm.replace('_rng', '_' + window.filterObj[ckey].type);
1436+
}
14241437
if ( ('rng' in window.filterObj[ckey]) && ('none' in window.filterObj[ckey]) ){
14251438
filtObj[nm] = [window.filterObj[ckey]['rng'],'None']
14261439
}
@@ -1517,6 +1530,10 @@ require([
15171530
) {
15181531
dicofdic['filt'] = data.filtered_counts.derived_set[facetSet].attributes;
15191532
}
1533+
else if (isFiltered)
1534+
{
1535+
dicofdic['filt'] = {};
1536+
}
15201537
else{
15211538
dicofdic['filt'] = data.derived_set[facetSet].attributes;
15221539
}
@@ -1636,17 +1653,20 @@ require([
16361653
var maxx=$('#' + filterId).data('attr-max');
16371654
var minx=$('#' + filterId).data('attr-min');
16381655

1656+
var parStr = $('#'+filterId).find('#'+filterId+'_slide').data('attr-par');
16391657

1640-
if ($('#'+filterId).find('.noneBut').length>0) {
1641-
var inpElem = $('#'+filterId).find('.noneBut')[0];
1642-
}
16431658

16441659
if(label == 'None') {
1645-
setSlider(filterId+"_slide", true, 0, maxx, true,false);
1660+
16461661
//var inpElem = $('#'+filterId).find('.noneBut')[0];
1647-
inpElem.checked=true;
1648-
var parStr = $(inpElem).data("attr-par");
1649-
window.addNone(inpElem,parStr,true);
1662+
if ($('#'+filterId).find('.noneBut').length>0) {
1663+
var inpElem = $('#'+filterId).find('.noneBut')[0];
1664+
inpElem.checked=true;
1665+
window.addNone(inpElem,parStr,false);
1666+
}
1667+
setSlider(filterId+"_slide", true, 0, maxx, true,true);
1668+
1669+
16501670
}
16511671
else {
16521672
if (! (typeof(inpElem)==="undefined")){

0 commit comments

Comments
 (0)