This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
close.pro
109 lines (99 loc) · 4.59 KB
/
close.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
;ImageQC - quality control of medical images
;Copyright (C) 2019 Ellen Wasbo, Stavanger University Hospital, Norway
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License version 2
;as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
pro closeImgs, imgIds
COMPILE_OPT hidden
COMMON VARI
sel=imgIds
IF sel(0) NE -1 THEN BEGIN
nImg=N_TAGS(structImgs)
selArr=INTARR(nImg) & selArr(sel)=1
remain=WHERE(selArr EQ 0);ids to keep (oposite of selArr)
IF marked(0) NE -1 THEN BEGIN; remove selected from marked
markedArr=INTARR(nImg) & markedArr(marked)=1
IF remain(0) NE -1 THEN markedArr=markedArr(remain)
marked=WHERE(markedArr EQ 1)
ENDIF
IF markedMulti(0) NE -1 THEN BEGIN
IF remain(0) NE -1 THEN BEGIN
szMM=SIZE(markedMulti, /DIMENSIONS)
markedMultiNew=INTARR(szMM(0),N_ELEMENTS(remain))
FOR p=0, szMM(0)-1 DO BEGIN
markedArr=markedMulti[p,*]
markedMultiNew[p,*]=markedArr(remain)
ENDFOR
markedMulti=markedMultiNew
ENDIF
ENDIF
structImgs=removeIDstructstruct(structImgs, sel)
stillEmpty=WHERE(TAG_NAMES(structImgs) EQ 'EMPTY')
IF stillEmpty(0) EQ -1 THEN BEGIN
IF WIDGET_INFO(lstShowFile, /DROPLIST_SELECT) EQ 0 THEN RDtemp='' ELSE RDtemp=modalityName
fileList=getListOpenFiles(structImgs,0,marked,markedMulti,RENAMEDICOM=RDtemp, CONFIGPATH=configPath, PARENT=evTop)
WIDGET_CONTROL, listFiles, YSIZE=n_elements(fileList), SET_VALUE=fileList, SET_LIST_SELECT=0, SET_LIST_TOP=0
WIDGET_CONTROL, listFiles, SCR_YSIZE=listFilesYsize
IF markedMulti(0) NE -1 THEN clearRes ELSE BEGIN; too complicated to keep results if markedMulti
analyseStrings=analyseStringsAll.(modality)
FOR i=0, N_ELEMENTS(results)-1 DO BEGIN
IF results(i) THEN BEGIN
CASE analyseStrings(i) OF
'DIM': dimRes=dimRes[*,remain]
'STP': clearRes, 'STP'
'HOMOG': homogRes=homogRes[*,remain]
'NOISE': clearRes, 'NOISE'; because avg dependent on rest - recalculation needed
'EXP': expRes=expRes[*,remain]
'DCM': expRes=expRes[*,remain]
'MTF': MTFres=removeIDstructstruct(MTFres,sel)
'NPS': NPSres=removeIDstructstruct(NPSres,sel)
'VARI': varImgRes=removeIDstructstruct(varImgRes,sel)
'CTLIN': CTlinres=CTlinres[*,remain]
'HUWATER': HUwaterRes=HUwaterRes[*,remain]
'ROI': ROIres=ROIres[*,remain]
'RING': BEGIN
ringArtProf=removeIDstructstruct(ringArtProf,sel)
ringArtRes=ringArtRes[*,remain]
END
'SLICETHICK': BEGIN
sliceThickRes=removeIDstructstruct(sliceThickRes,sel)
sliceThickResTab=sliceThickResTab[*,remain]
END
'FWHM': fwhmRes=fwhmRes[*,remain]
'ENERGYSPEC':
'SCANSPEED':
'CONTRAST': contrastRes=contrastRes[*,remain]
'RADIAL': clearRes, 'RADIAL';less could be done, but - no time right no - fix later to keep remaining results
'UNIF': clearRes, 'UNIF';less could be done, but - no time right no - fix later to keep remaining results
'SNI': BEGIN
SNIres=removeIDstructstruct(SNIres,sel)
SNIsupTab=SNIsupTab[*,remain]
END
'BAR': barRes=barRes[*,remain]
'CROSSCALIB': clearRes, 'CROSSCALIB'
'RC': clearRes, 'RC';probably less could be done, but - just in case some trouble
'SNR': clearRes, 'SNR'
'PIU': PIUres=PIUres[*,remain]
'GHOST': ghostMRres=ghostMRres[*,remain]
'GEOMDIST': GeomDistRes=GeomDistRes[*,remain]
ENDCASE
ENDIF
ENDFOR
ENDELSE
redrawImg,0,1
updateInfo
WIDGET_CONTROL, lblLoadedN, SET_VALUE=STRING(n_elements(fileList), FORMAT='(i0)')+' )'
ENDIF ELSE clearAll
ENDIF
end