1 | #pragma TextEncoding = "MacRoman" |
---|
2 | #pragma rtGlobals=3 // Use modern global access method and strict wave access. |
---|
3 | |
---|
4 | // |
---|
5 | // Mask utilities: |
---|
6 | // - loader |
---|
7 | // - simple editor |
---|
8 | // - save mask file |
---|
9 | // - assign mask file to data file |
---|
10 | // |
---|
11 | // |
---|
12 | // |
---|
13 | // |
---|
14 | // |
---|
15 | // |
---|
16 | |
---|
17 | ///// LOADING |
---|
18 | |
---|
19 | // TODO |
---|
20 | // x- when mask is loaded, need to be sure to clean up the "extra" waves that may be present |
---|
21 | // |
---|
22 | // x- the overlay and the currentTube waves since these are not overwritten or killed when new mask |
---|
23 | // data is read in from HDF. need to manually? check for these and delete then, or the data and |
---|
24 | // mask overlay will be out of sync. |
---|
25 | // |
---|
26 | |
---|
27 | |
---|
28 | // passing null file string presents a dialog |
---|
29 | // called from the Main Button " Read Mask" |
---|
30 | Proc V_LoadMASKData() |
---|
31 | V_LoadHDF5Data("","MSK") |
---|
32 | End |
---|
33 | |
---|
34 | |
---|
35 | |
---|
36 | //// DRAWING/SAVING |
---|
37 | // |
---|
38 | // (DONE) |
---|
39 | // x- CHANGE the mask behavior to a more logical choice - and consistent with SANS |
---|
40 | // x- CHANGE to: |
---|
41 | // 1 == mask == discard data |
---|
42 | // 0 == no Mask == keep data |
---|
43 | // x- and then make the corresponding changes in the I(Q) routines |
---|
44 | // |
---|
45 | // x- move the mask generating utilities from VC_HDF5_Utils into this procedure - to keep |
---|
46 | // all of the mask procedures together |
---|
47 | |
---|
48 | |
---|
49 | // TODO |
---|
50 | // -- document the arrow keys moving the tube number and adding/deleting tubes from the mask |
---|
51 | // this is done through a window hook function (LR moves tube number, up/down = add/delete) |
---|
52 | // |
---|
53 | // (DONE) |
---|
54 | // x- (NO)- Igor 7 is necessary for some VSANS functionality, so do not support Igor 6 |
---|
55 | // x (no)make the arrow keys Igor 6 compatible - search for specialKeyCode or Keyboard Events in the help file |
---|
56 | // and what needs to be replaced for Igor 6 |
---|
57 | // DONE |
---|
58 | // x- for L/R panels, the maksing of columns should be sufficient. Tubes are vertical. For the T/B panels |
---|
59 | // the L/R panels cast a vertical shadow (=vertical mask) AND the tubes are horizontal, so the individual |
---|
60 | // tubes will likely need to be masked in a horizontal line too, per tube. ADD this in... |
---|
61 | |
---|
62 | |
---|
63 | //TODO |
---|
64 | // x- draw a mask |
---|
65 | // x- save a mask (all panels) |
---|
66 | // x- move everything into it's own folder, rather than root: |
---|
67 | // -- be able to save the mask name to the RAW data file |
---|
68 | // -- be able to read a mask based on what name is in the data file |
---|
69 | // |
---|
70 | // x- biggest thing now is to re-write the DrawDetPanel() routine from the beamCenter.ipf |
---|
71 | // to do what this panel needs |
---|
72 | // |
---|
73 | // x- add this to the list of includes, move the file to SVN, and add it. |
---|
74 | // |
---|
75 | // -- for working with VCALC -- maybe have an automatic generator (if val < -2e6, mask = 0) |
---|
76 | // this can be checked column-wise to go faster (1st index) |
---|
77 | // |
---|
78 | // x- re-write V_OverlayMask to make the "overlay" wave that has the NaNs, and then the drawing |
---|
79 | // routines need to be aware of this |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | // called from the main button "Draw Mask" |
---|
84 | Proc V_Edit_a_Mask() |
---|
85 | V_EditMask() |
---|
86 | end |
---|
87 | |
---|
88 | Function V_EditMask() |
---|
89 | DoWindow/F MaskEditPanel |
---|
90 | if(V_flag==0) |
---|
91 | |
---|
92 | NewDataFolder/O root:Packages:NIST:VSANS:Globals:Mask |
---|
93 | |
---|
94 | Variable/G root:Packages:NIST:VSANS:Globals:Mask:gMaskTube = 0 |
---|
95 | Variable/G root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex = 47 |
---|
96 | |
---|
97 | // check for a mask, if not present, generate a default mask |
---|
98 | String str="FT" |
---|
99 | wave/Z maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
100 | if(!WaveExists(maskW)) |
---|
101 | V_GenerateDefaultMask() |
---|
102 | endif |
---|
103 | |
---|
104 | Execute "V_MaskEditorPanel()" |
---|
105 | endif |
---|
106 | End |
---|
107 | |
---|
108 | // |
---|
109 | // TODO |
---|
110 | // -- may need to adjust the display for the different pixel dimensions |
---|
111 | // ModifyGraph width={Plan,1,bottom,left} |
---|
112 | // |
---|
113 | // TODO |
---|
114 | // need buttons for: |
---|
115 | // x- quit (to exit gracefully) (no, just close the window is fine) |
---|
116 | // x- help (button is there, fill in the content) |
---|
117 | // |
---|
118 | Proc V_MaskEditorPanel() |
---|
119 | PauseUpdate; Silent 1 // building window... |
---|
120 | |
---|
121 | Display /W=(662,418,1300,960)/N=MaskEditPanel /K=1 |
---|
122 | |
---|
123 | ShowTools rect |
---|
124 | ControlBar 100 |
---|
125 | |
---|
126 | PopupMenu popup_0,pos={18,40},size={109,20},proc=V_SetMaskPanelPopMenuProc,title="Detector Panel" |
---|
127 | PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\"" |
---|
128 | PopupMenu popup_2,pos={18,10},size={109,20},title="Data Source"//,proc=SetFldrPopMenuProc |
---|
129 | PopupMenu popup_2,mode=1,popvalue="RAW",value= #"\"RAW;SAM;VCALC;\"" |
---|
130 | |
---|
131 | SetVariable setvar0,pos={226,32},size={112,23},title="tube number" |
---|
132 | SetVariable setvar0,limits={0,127,1},value=root:Packages:NIST:VSANS:Globals:Mask:gMaskTube |
---|
133 | Button button_0,pos={226,58},size={50.00,20.00},proc=V_AddToMaskButtonProc,title="Add" |
---|
134 | Button button_1,pos={288,58},size={50.00,20.00},proc=V_RemoveFromMaskButtonProc,title="Del" |
---|
135 | Button button_2,pos={496,41},size={90.00,20.00},proc=V_ToggleMaskButtonProc,title="Toggle" |
---|
136 | Button button_3,pos={506,66},size={80.00,20.00},proc=V_SaveMaskButtonProc,title="Save" |
---|
137 | CheckBox check_0,pos={174,35},size={37.00,15.00},proc=V_DrawMaskRadioCheckProc,title="Row" |
---|
138 | CheckBox check_0,value= 0,mode=1 |
---|
139 | CheckBox check_1,pos={174,58},size={32.00,15.00},proc=V_DrawMaskRadioCheckProc,title="Col" |
---|
140 | CheckBox check_1,value= 1,mode=1 |
---|
141 | |
---|
142 | Button button_5,pos={18,70.00},size={70.00,20.00},proc=V_MaskToolsButton,title="Tools" |
---|
143 | Button button_6,pos={380,33},size={90.00,20.00},proc=V_AddShapeToMaskButtonProc,title="Add Shape" |
---|
144 | Button button_7,pos={380,58},size={90.00,20.00},proc=V_AddShapeToMaskButtonProc,title="Del Shape" |
---|
145 | Button button_8,pos={556.00,14.00},size={30.00,20.00},proc=V_DrawMaskHelpButtonProc,title="?" |
---|
146 | |
---|
147 | GroupBox group0,pos={163.00,5.00},size={188.00,90.00},title="Mask Tubes" |
---|
148 | GroupBox group1,pos={365.00,5.00},size={122.00,90.00},title="Mask Shapes" |
---|
149 | |
---|
150 | SetWindow MaskEditPanel, hook(MyHook)=V_MaskWindowHook |
---|
151 | |
---|
152 | // draw the correct images |
---|
153 | //draw the detector panel |
---|
154 | V_DrawPanelToMask("FL") |
---|
155 | |
---|
156 | // overlay the current mask |
---|
157 | V_OverlayMask("FL",1) |
---|
158 | |
---|
159 | SetDrawLayer/W=MaskEditPanel ProgFront |
---|
160 | SetDrawEnv/W=MaskEditPanel xcoord= bottom,ycoord= left,save //be sure to use axis coordinate mode |
---|
161 | EndMacro |
---|
162 | |
---|
163 | Function V_DrawMaskHelpButtonProc(ba) : ButtonControl |
---|
164 | STRUCT WMButtonAction &ba |
---|
165 | |
---|
166 | switch( ba.eventCode ) |
---|
167 | case 2: // mouse up |
---|
168 | // click code here |
---|
169 | DoAlert 0, "Draw Mask Help not written yet..." |
---|
170 | break |
---|
171 | case -1: // control being killed |
---|
172 | break |
---|
173 | endswitch |
---|
174 | |
---|
175 | return 0 |
---|
176 | End |
---|
177 | |
---|
178 | // |
---|
179 | //a simple toggle between the two, so the logic is not done in the cleanest way. |
---|
180 | // |
---|
181 | // update the limits on the tube nubmer based on row/col and the panel (gMaskMaxIndex global) |
---|
182 | // |
---|
183 | Function V_DrawMaskRadioCheckProc(cba) : CheckBoxControl |
---|
184 | STRUCT WMCheckboxAction &cba |
---|
185 | |
---|
186 | switch( cba.eventCode ) |
---|
187 | case 2: // mouse up |
---|
188 | Variable checked = cba.checked |
---|
189 | String name = cba.ctrlName |
---|
190 | |
---|
191 | //get information to update the limits on the tube number setvar |
---|
192 | ControlInfo popup_0 |
---|
193 | String str=S_Value |
---|
194 | wave data = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
195 | Variable val |
---|
196 | |
---|
197 | // update the radio button status and the setvar limits |
---|
198 | if(cmpstr(name,"check_0") == 0) // ROW is being selected |
---|
199 | CheckBox check_0,value = 1 |
---|
200 | CheckBox check_1,value = 0 |
---|
201 | val = DimSize(data, 1) -1 |
---|
202 | else |
---|
203 | // COL is being selected |
---|
204 | CheckBox check_0,value = 0 |
---|
205 | CheckBox check_1,value = 1 |
---|
206 | val = DimSize(data, 0) -1 |
---|
207 | endif |
---|
208 | |
---|
209 | // print "max = ",val |
---|
210 | |
---|
211 | SetVariable setvar0,limits={0,val,1} |
---|
212 | NVAR gVal = root:Packages:NIST:VSANS:Globals:Mask:gMaskTube |
---|
213 | NVAR gMax = root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex |
---|
214 | gMax = val |
---|
215 | if(gVal > val) |
---|
216 | gVal = val |
---|
217 | endif |
---|
218 | |
---|
219 | break |
---|
220 | case -1: // control being killed |
---|
221 | break |
---|
222 | endswitch |
---|
223 | |
---|
224 | return 0 |
---|
225 | End |
---|
226 | |
---|
227 | Function V_MaskWindowHook(s) |
---|
228 | STRUCT WMWinHookStruct &s |
---|
229 | |
---|
230 | Variable hookResult = 0 // 0 if we do not handle event, 1 if we handle it. |
---|
231 | |
---|
232 | String message = "" |
---|
233 | |
---|
234 | switch(s.eventCode) |
---|
235 | case 11: // Keyboard event |
---|
236 | // String keyCodeInfo |
---|
237 | // sprintf keyCodeInfo, "s.keycode = 0x%04X", s.keycode |
---|
238 | // if (strlen(message) > 0) |
---|
239 | // message += "\r" |
---|
240 | // endif |
---|
241 | // message +=keyCodeInfo |
---|
242 | // |
---|
243 | // message += "\r" |
---|
244 | // String specialKeyCodeInfo |
---|
245 | // sprintf specialKeyCodeInfo, "s.specialKeyCode = %d", s.specialKeyCode |
---|
246 | // message +=specialKeyCodeInfo |
---|
247 | // message += "\r" |
---|
248 | // |
---|
249 | // String keyTextInfo |
---|
250 | // sprintf keyTextInfo, "s.keyText = \"%s\"", s.keyText |
---|
251 | // message +=keyTextInfo |
---|
252 | // |
---|
253 | // String text = "\\Z24" + message |
---|
254 | // Textbox /C/N=Message/W=KeyboardEventsGraph/A=MT/X=0/Y=15 text |
---|
255 | |
---|
256 | // NOTE: these special keyCodes are all Igor-7 ONLY |
---|
257 | |
---|
258 | // Note that I need to keep track of the index value since I'm intercepting the |
---|
259 | // SetVariable event here. I need to keep the index in range. |
---|
260 | STRUCT WMButtonAction ba |
---|
261 | ba.eventCode = 2 |
---|
262 | NVAR tubeVal = root:Packages:NIST:VSANS:Globals:Mask:gMaskTube |
---|
263 | if(s.specialKeyCode == 100) |
---|
264 | //left arrow |
---|
265 | tubeVal -= 1 |
---|
266 | endif |
---|
267 | if(s.specialKeyCode == 101) |
---|
268 | //right arrow |
---|
269 | tubeVal += 1 |
---|
270 | endif |
---|
271 | if(s.specialKeyCode == 102) |
---|
272 | //up arrow |
---|
273 | V_AddToMaskButtonProc(ba) |
---|
274 | endif |
---|
275 | if(s.specialKeyCode == 103) |
---|
276 | //down arrow |
---|
277 | V_RemoveFromMaskButtonProc(ba) |
---|
278 | endif |
---|
279 | |
---|
280 | // enforce the limits on the setvar |
---|
281 | NVAR gMax = root:Packages:NIST:VSANS:Globals:Mask:gMaskMaxIndex |
---|
282 | if(tubeVal > gMax) |
---|
283 | tubeVal = gMax |
---|
284 | endif |
---|
285 | if(tubeVal < 0) |
---|
286 | tubeVal = 0 |
---|
287 | endif |
---|
288 | |
---|
289 | // draw the "currentTube" every time |
---|
290 | ControlInfo popup_0 |
---|
291 | String str=S_Value |
---|
292 | wave currentTube = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":currentTube") |
---|
293 | |
---|
294 | // update so that the proper row is displayed on the currentTube |
---|
295 | currentTube = 0 |
---|
296 | |
---|
297 | ControlInfo check_0 // is it row? |
---|
298 | Variable isRow = V_value |
---|
299 | if(isRow) |
---|
300 | currentTube[][tubeVal] = 1 |
---|
301 | else |
---|
302 | currentTube[tubeVal][] = 1 |
---|
303 | endif |
---|
304 | |
---|
305 | |
---|
306 | hookResult = 1 // We handled keystroke |
---|
307 | break |
---|
308 | endswitch |
---|
309 | |
---|
310 | return hookResult // If non-zero, we handled event and Igor will ignore it. |
---|
311 | End |
---|
312 | |
---|
313 | // toggles the view of the mask, either show the mask, or hide it |
---|
314 | // |
---|
315 | Function V_ToggleMaskButtonProc(ba) : ButtonControl |
---|
316 | STRUCT WMButtonAction &ba |
---|
317 | |
---|
318 | switch( ba.eventCode ) |
---|
319 | case 2: // mouse up |
---|
320 | // click code here |
---|
321 | |
---|
322 | ControlInfo popup_0 |
---|
323 | String str=S_Value |
---|
324 | |
---|
325 | wave/Z overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") |
---|
326 | |
---|
327 | CheckDisplayed/W=MaskEditPanel overlay |
---|
328 | Variable state = !(V_flag) //if V_flag == 0, then set to 1 (and vice versa) |
---|
329 | V_OverlayMask(str,state) |
---|
330 | |
---|
331 | break |
---|
332 | case -1: // control being killed |
---|
333 | break |
---|
334 | endswitch |
---|
335 | |
---|
336 | return 0 |
---|
337 | End |
---|
338 | |
---|
339 | // adds a row (or column) to the mask |
---|
340 | // |
---|
341 | Function V_AddToMaskButtonProc(ba) : ButtonControl |
---|
342 | STRUCT WMButtonAction &ba |
---|
343 | |
---|
344 | switch( ba.eventCode ) |
---|
345 | case 2: // mouse up |
---|
346 | // click code here |
---|
347 | ControlInfo popup_0 |
---|
348 | String str=S_Value |
---|
349 | |
---|
350 | wave/Z maskData = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
351 | |
---|
352 | Variable val |
---|
353 | ControlInfo setvar0 //get the tube number |
---|
354 | val = V_Value |
---|
355 | |
---|
356 | ControlInfo check_0 // is it row? |
---|
357 | Variable isRow = V_value |
---|
358 | if(isRow) |
---|
359 | maskData[][val] = 1 |
---|
360 | else |
---|
361 | maskData[val][] = 1 |
---|
362 | endif |
---|
363 | |
---|
364 | V_OverlayMask(str,1) |
---|
365 | |
---|
366 | break |
---|
367 | case -1: // control being killed |
---|
368 | break |
---|
369 | endswitch |
---|
370 | |
---|
371 | return 0 |
---|
372 | End |
---|
373 | |
---|
374 | // |
---|
375 | //adds or erases the mask, based on which button was clicked |
---|
376 | // (only checks for "add shape", otherwise erases mask) |
---|
377 | // |
---|
378 | Function V_AddShapeToMaskButtonProc(ba) : ButtonControl |
---|
379 | STRUCT WMButtonAction &ba |
---|
380 | |
---|
381 | switch( ba.eventCode ) |
---|
382 | case 2: // mouse up |
---|
383 | // click code here |
---|
384 | ControlInfo popup_0 |
---|
385 | String str=S_Value |
---|
386 | |
---|
387 | wave/Z data = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
388 | |
---|
389 | SetDrawLayer/W=MaskEditPanel ProgFront |
---|
390 | SetDrawEnv/W=MaskEditPanel xcoord= bottom,ycoord= left,save //be sure to use axis coordinate mode |
---|
391 | |
---|
392 | ImageGenerateROIMask/W=MaskEditPanel curDispPanel //M_ROIMask is in the root: folder |
---|
393 | |
---|
394 | WAVE M_ROIMask=M_ROIMask |
---|
395 | if(cmpstr("button_6",ba.ctrlName)==0) |
---|
396 | data = (data || M_ROIMask) // 0=0, 1=1 == "drawing" more mask points |
---|
397 | else |
---|
398 | data = (M_ROIMask[p][q] == 1 && data[p][q] == 1) ? 0 : data[p][q] // if the drawn shape = 1, set the mask to 0 (erase) |
---|
399 | endif |
---|
400 | |
---|
401 | V_OverlayMask(str,1) |
---|
402 | |
---|
403 | SetDrawLayer/K ProgFront |
---|
404 | SetDrawLayer/W=MaskEditPanel ProgFront |
---|
405 | SetDrawEnv/W=MaskEditPanel xcoord= bottom,ycoord= left,save //be sure to use axis coordinate mode |
---|
406 | break |
---|
407 | case -1: // control being killed |
---|
408 | break |
---|
409 | endswitch |
---|
410 | |
---|
411 | return 0 |
---|
412 | End |
---|
413 | |
---|
414 | // show the tools (they are there by default) |
---|
415 | // |
---|
416 | Function V_MaskToolsButton(ba) : ButtonControl |
---|
417 | STRUCT WMButtonAction &ba |
---|
418 | |
---|
419 | switch( ba.eventCode ) |
---|
420 | case 2: // mouse up |
---|
421 | // click code here |
---|
422 | |
---|
423 | ShowTools rect |
---|
424 | |
---|
425 | SetDrawLayer/W=MaskEditPanel ProgFront |
---|
426 | SetDrawEnv/W=MaskEditPanel xcoord= bottom,ycoord= left,save //be sure to use axis coordinate mode |
---|
427 | SetDrawEnv/W=MaskEditPanel fillPat=1 |
---|
428 | |
---|
429 | break |
---|
430 | case -1: // control being killed |
---|
431 | break |
---|
432 | endswitch |
---|
433 | |
---|
434 | return 0 |
---|
435 | End |
---|
436 | |
---|
437 | // un-mask a row or column |
---|
438 | // |
---|
439 | Function V_RemoveFromMaskButtonProc(ba) : ButtonControl |
---|
440 | STRUCT WMButtonAction &ba |
---|
441 | |
---|
442 | switch( ba.eventCode ) |
---|
443 | case 2: // mouse up |
---|
444 | // click code here |
---|
445 | ControlInfo popup_0 |
---|
446 | String str=S_Value |
---|
447 | |
---|
448 | wave/Z maskData = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
449 | |
---|
450 | Variable val |
---|
451 | ControlInfo setvar0 // get the tube number |
---|
452 | val = V_Value |
---|
453 | |
---|
454 | ControlInfo check_0 // is it row? |
---|
455 | Variable isRow = V_value |
---|
456 | if(isRow) |
---|
457 | maskData[][val] = 0 |
---|
458 | else |
---|
459 | maskData[val][] = 0 |
---|
460 | endif |
---|
461 | |
---|
462 | V_OverlayMask(str,1) |
---|
463 | |
---|
464 | break |
---|
465 | case -1: // control being killed |
---|
466 | break |
---|
467 | endswitch |
---|
468 | |
---|
469 | return 0 |
---|
470 | End |
---|
471 | |
---|
472 | // |
---|
473 | // function to choose which detector panel to display, and then to actually display it |
---|
474 | // |
---|
475 | Function V_SetMaskPanelPopMenuProc(pa) : PopupMenuControl |
---|
476 | STRUCT WMPopupAction &pa |
---|
477 | |
---|
478 | switch( pa.eventCode ) |
---|
479 | case 2: // mouse up |
---|
480 | Variable popNum = pa.popNum |
---|
481 | String popStr = pa.popStr |
---|
482 | |
---|
483 | // remove the old image (it may not be the right shape) |
---|
484 | // -- but make sure it exists first... |
---|
485 | |
---|
486 | String list = ImageNameList("", ";" ) |
---|
487 | Variable num=ItemsInList(list) |
---|
488 | Variable ii |
---|
489 | for(ii=0;ii<num;ii+=1) |
---|
490 | // Wave w = ImageNameToWaveRef("", StringFromList(ii, list,";")) |
---|
491 | // CheckDisplayed/W=MaskEditPanel w |
---|
492 | |
---|
493 | RemoveImage/W=MaskEditPanel $(StringFromList(ii, list,";")) |
---|
494 | endfor |
---|
495 | |
---|
496 | |
---|
497 | |
---|
498 | // draw the correct images |
---|
499 | V_DrawPanelToMask(popStr) |
---|
500 | |
---|
501 | // fake a "click" on the radio buttons to re-set the row/col limits |
---|
502 | STRUCT WMCheckboxAction cba |
---|
503 | cba.eventCode = 2 |
---|
504 | |
---|
505 | ControlInfo check_0 |
---|
506 | if(V_flag == 1) //row is currently selected |
---|
507 | cba.ctrlName = "check_0" |
---|
508 | else |
---|
509 | cba.ctrlName = "check_1" |
---|
510 | endif |
---|
511 | |
---|
512 | V_DrawMaskRadioCheckProc(cba) //call the radio button action proc |
---|
513 | |
---|
514 | //overlay the mask (removes the old mask first) |
---|
515 | V_OverlayMask(popStr,1) |
---|
516 | |
---|
517 | SetDrawLayer/K ProgFront |
---|
518 | SetDrawLayer/W=MaskEditPanel ProgFront |
---|
519 | SetDrawEnv/W=MaskEditPanel xcoord= bottom,ycoord= left,save //be sure to use axis coordinate mode |
---|
520 | |
---|
521 | break |
---|
522 | case -1: // control being killed |
---|
523 | break |
---|
524 | endswitch |
---|
525 | |
---|
526 | return 0 |
---|
527 | End |
---|
528 | |
---|
529 | // |
---|
530 | // SEE DrawDetPanel() in the BeamCenter file |
---|
531 | // |
---|
532 | // TODO |
---|
533 | // x- currently is hard-wired for the simulation path! need to make it more generic, especially for RAW data |
---|
534 | // |
---|
535 | // -- need to adjust the size of the image subwindows |
---|
536 | // |
---|
537 | // x- need to do something for panel "B". currently ignored |
---|
538 | // |
---|
539 | // |
---|
540 | // draw the selected panel and the model calculation, adjusting for the |
---|
541 | // orientation of the panel and the number of pixels, and pixel sizes |
---|
542 | Function V_DrawPanelToMask(str) |
---|
543 | String str |
---|
544 | |
---|
545 | // from the selection, find the path to the data |
---|
546 | |
---|
547 | Variable xDim,yDim |
---|
548 | Variable left,top,right,bottom |
---|
549 | Variable height, width |
---|
550 | Variable left2,top2,right2,bottom2 |
---|
551 | Variable nPix_X,nPix_Y,pixSize_X,pixSize_Y |
---|
552 | |
---|
553 | |
---|
554 | // Wave dispW=root:curDispPanel |
---|
555 | |
---|
556 | //plot it in the subwindow with the proper aspect and positioning |
---|
557 | // for 48x256 (8mm x 4mm), aspect = (256/2)/48 = 2.67 (LR panels) |
---|
558 | // for 128x48 (4mm x 8 mm), aspect = 48/(128/2) = 0.75 (TB panels) |
---|
559 | |
---|
560 | |
---|
561 | // using two switches -- one to set the panel-specific dimensions |
---|
562 | // and the other to set the "common" values, some of which are based on the panel dimensions |
---|
563 | |
---|
564 | // set the source of the data. not always VCALC anymore |
---|
565 | String folder |
---|
566 | ControlInfo popup_2 |
---|
567 | folder = S_Value |
---|
568 | |
---|
569 | // TODO -- fix all of this mess |
---|
570 | if(cmpstr(folder,"VCALC") == 0) |
---|
571 | // panel-specific values |
---|
572 | Variable VC_nPix_X = VCALC_get_nPix_X(str) |
---|
573 | Variable VC_nPix_Y = VCALC_get_nPix_Y(str) |
---|
574 | Variable VC_pixSize_X = VCALC_getPixSizeX(str) |
---|
575 | Variable VC_pixSize_Y = VCALC_getPixSizeY(str) |
---|
576 | |
---|
577 | |
---|
578 | // if VCALC declare this way |
---|
579 | wave newW = $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+str+":det_"+str) |
---|
580 | nPix_X = VC_nPix_X |
---|
581 | nPix_Y = VC_nPix_Y |
---|
582 | pixSize_X = VC_pixSize_X |
---|
583 | pixSize_Y = VC_pixSize_Y |
---|
584 | |
---|
585 | else |
---|
586 | // TODO: if real data, need new declaration w/ data as the wave name |
---|
587 | wave newW = $("root:Packages:NIST:VSANS:"+folder+":entry:instrument:detector_"+str+":data") |
---|
588 | |
---|
589 | nPix_X = V_getDet_pixel_num_x(folder,str) |
---|
590 | nPix_Y = V_getDet_pixel_num_Y(folder,str) |
---|
591 | pixSize_X = V_getDet_x_pixel_size(folder,str)/10 |
---|
592 | pixSize_Y = V_getDet_y_pixel_size(folder,str)/10 |
---|
593 | endif |
---|
594 | |
---|
595 | |
---|
596 | Variable scale = 10 |
---|
597 | |
---|
598 | // common values (panel position, etc) |
---|
599 | // TODO -- units are absolute, based on pixels in cm. make sure this is always correct |
---|
600 | strswitch(str) |
---|
601 | case "FL": |
---|
602 | case "FR": |
---|
603 | case "ML": |
---|
604 | case "MR": |
---|
605 | width = trunc(nPix_X*pixSize_X *scale*1.15) //48 tubes @ 8 mm |
---|
606 | height = trunc(nPix_Y*pixSize_Y *scale*0.8) //128 pixels @ 8 mm |
---|
607 | |
---|
608 | left = 20 |
---|
609 | top = 80 |
---|
610 | right = left+width |
---|
611 | bottom = top+height |
---|
612 | |
---|
613 | left2 = right + 20 |
---|
614 | right2 = left2 + width |
---|
615 | top2 = top |
---|
616 | bottom2 = bottom |
---|
617 | |
---|
618 | break |
---|
619 | case "FT": |
---|
620 | case "FB": |
---|
621 | case "MT": |
---|
622 | case "MB": |
---|
623 | width = trunc(nPix_X*pixSize_X *scale*1.) //128 pix @ 4 mm |
---|
624 | height = trunc(nPix_Y*pixSize_Y *scale) // 48 tubes @ 8 mm |
---|
625 | |
---|
626 | left = 20 |
---|
627 | top = 80 |
---|
628 | right = left+width |
---|
629 | bottom = top+height |
---|
630 | |
---|
631 | left2 = left |
---|
632 | right2 = right |
---|
633 | top2 = top + height + 20 |
---|
634 | bottom2 = bottom + height + 20 |
---|
635 | |
---|
636 | break |
---|
637 | case "B": |
---|
638 | width = trunc(nPix_X/3.2) // |
---|
639 | height = trunc(nPix_Y/3.2) // |
---|
640 | |
---|
641 | left = 20 |
---|
642 | top = 80 |
---|
643 | right = left+width |
---|
644 | bottom = top+height |
---|
645 | |
---|
646 | Print left,top,right,bottom |
---|
647 | |
---|
648 | break |
---|
649 | default: |
---|
650 | return(0) //just exit |
---|
651 | endswitch |
---|
652 | |
---|
653 | SetDataFolder root:Packages:NIST:VSANS:Globals:Mask |
---|
654 | |
---|
655 | // generate the new panel display |
---|
656 | duplicate/O newW curDispPanel |
---|
657 | SetScale/P x 0,1, curDispPanel |
---|
658 | SetScale/P y 0,1, curDispPanel |
---|
659 | |
---|
660 | NVAR defaultLogScaling = root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault |
---|
661 | if(defaultLogScaling) |
---|
662 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:logLookupWave |
---|
663 | else |
---|
664 | Wave LookupWave = root:Packages:NIST:VSANS:Globals:linearLookupWave |
---|
665 | endif |
---|
666 | |
---|
667 | //draw the detector panel |
---|
668 | // Display/W=(left,top,right,bottom) |
---|
669 | AppendImage curDispPanel |
---|
670 | ModifyImage curDispPanel ctab= {*,*,ColdWarm,0} |
---|
671 | // ModifyImage curDispPanel log=1 // this fails, since there are data values that are zero |
---|
672 | ModifyImage curDispPanel ctabAutoscale=0,lookup= LookupWave |
---|
673 | Label left "Y pixels" |
---|
674 | Label bottom "X pixels" |
---|
675 | |
---|
676 | |
---|
677 | DoUpdate |
---|
678 | |
---|
679 | SetDataFolder root: |
---|
680 | return(0) |
---|
681 | End |
---|
682 | |
---|
683 | // |
---|
684 | // overlay the mask |
---|
685 | // |
---|
686 | // (DONE) |
---|
687 | // x- remove the old mask first |
---|
688 | // x- make the mask "toggle" to remove it |
---|
689 | // x- go see SANS for color, implementation, etc. |
---|
690 | // x- un-comment the (two) calls |
---|
691 | // |
---|
692 | // |
---|
693 | //toggles a mask on/off of the SANS_Data window |
---|
694 | // points directly to window, doesn't need current display type |
---|
695 | // |
---|
696 | // if state==1, show the mask, if ==0, hide the mask |
---|
697 | // |
---|
698 | //** This assumes that if the overlay is/not present on the image display, then the currentTube is also there/not |
---|
699 | // and is not checked |
---|
700 | // |
---|
701 | Function V_OverlayMask(str,state) |
---|
702 | String str |
---|
703 | Variable state |
---|
704 | |
---|
705 | |
---|
706 | String maskPath = "root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data" |
---|
707 | if(WaveExists($maskPath) == 1) |
---|
708 | if(state == 1) |
---|
709 | //duplicate the mask, which is named "data" |
---|
710 | wave maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
711 | |
---|
712 | Duplicate/O maskW $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") |
---|
713 | wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") |
---|
714 | Duplicate/O maskW $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":currentTube") |
---|
715 | wave currentTube = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":currentTube") |
---|
716 | |
---|
717 | Redimension/D overlay,currentTube |
---|
718 | SetScale/P x 0,1, overlay,currentTube |
---|
719 | SetScale/P y 0,1, overlay,currentTube |
---|
720 | |
---|
721 | // overlay = (maskW == 1) ? 1 : NaN //no need to do this - simply adjust the coloring |
---|
722 | |
---|
723 | // update so that the proper row is displayed on the currentTube |
---|
724 | currentTube = 0 |
---|
725 | |
---|
726 | Variable val |
---|
727 | ControlInfo setvar0 //get the tube number |
---|
728 | val = V_Value |
---|
729 | |
---|
730 | ControlInfo check_0 // is it row? |
---|
731 | Variable isRow = V_value |
---|
732 | if(isRow) |
---|
733 | currentTube[][val] = 1 |
---|
734 | else |
---|
735 | currentTube[val][] = 1 |
---|
736 | endif |
---|
737 | |
---|
738 | CheckDisplayed/W=MaskEditPanel overlay |
---|
739 | if(V_flag==0) //so the overlay doesn't get appended more than once |
---|
740 | AppendImage/W=MaskEditPanel overlay |
---|
741 | AppendImage/W=MaskEditPanel currentTube |
---|
742 | // ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0.9,1,BlueRedGreen,0} ,minRGB=NaN,maxRGB=0 |
---|
743 | ModifyImage/W=MaskEditPanel overlay ctab= {0.9,0.95,BlueRedGreen,0} ,minRGB=NaN,maxRGB=(0,65000,0,40000) |
---|
744 | ModifyImage/W=MaskEditPanel currentTube ctab= {0.9,1,CyanMagenta,0} ,minRGB=NaN,maxRGB=0 |
---|
745 | // ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0,*,BlueRedGreen,0} |
---|
746 | endif |
---|
747 | endif |
---|
748 | |
---|
749 | if(state == 0) |
---|
750 | wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") |
---|
751 | wave currentTube = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":currentTube") |
---|
752 | |
---|
753 | CheckDisplayed/W=MaskEditPanel overlay |
---|
754 | // Print "V_flag = ",V_flag |
---|
755 | |
---|
756 | If(V_Flag == 1) //overlay is present |
---|
757 | RemoveImage/W=MaskEditPanel overlay |
---|
758 | RemoveImage/W=MaskEditPanel currentTube |
---|
759 | endif |
---|
760 | endif |
---|
761 | Endif |
---|
762 | |
---|
763 | return(0) |
---|
764 | End |
---|
765 | |
---|
766 | |
---|
767 | Function V_SaveMaskButtonProc(ba) : ButtonControl |
---|
768 | STRUCT WMButtonAction &ba |
---|
769 | |
---|
770 | switch( ba.eventCode ) |
---|
771 | case 2: // mouse up |
---|
772 | // click code here |
---|
773 | |
---|
774 | // fills in a "default mask" in a separate folder to then write out |
---|
775 | Execute "H_Setup_VSANS_MASK_Structure()" |
---|
776 | |
---|
777 | // fill with current "stuff" |
---|
778 | SetDataFolder root:VSANS_MASK_file:entry |
---|
779 | Wave/T title = title |
---|
780 | title = "This is a custom MASK file for VSANS: VSANS_MASK" |
---|
781 | SetDataFolder root: |
---|
782 | |
---|
783 | |
---|
784 | // copy over what was actually drawn for all of the detector panels |
---|
785 | |
---|
786 | Variable ii |
---|
787 | String str |
---|
788 | for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) |
---|
789 | str = StringFromList(ii, ksDetectorListAll, ";") |
---|
790 | Wave det_str = $("root:VSANS_MASK_file:entry:instrument:detector_"+str+":data") |
---|
791 | wave maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") |
---|
792 | det_str = maskW |
---|
793 | endfor |
---|
794 | |
---|
795 | //save it |
---|
796 | // String fileName = "ThisIsAMASK" |
---|
797 | |
---|
798 | Execute "Save_VSANS_MASK_Nexus()" |
---|
799 | |
---|
800 | break |
---|
801 | case -1: // control being killed |
---|
802 | break |
---|
803 | endswitch |
---|
804 | |
---|
805 | SetDataFolder root: |
---|
806 | return 0 |
---|
807 | End |
---|
808 | |
---|
809 | |
---|
810 | ////////////// fake MASK file tests |
---|
811 | // |
---|
812 | // |
---|
813 | // Make/O/T/N=1 file_name = "VSANS_MASK_test.h5" |
---|
814 | // |
---|
815 | // simple generation of a fake MASK file. for sans, nothing other than the creation date was written to the |
---|
816 | // file header. nothing more is needed (possibly) |
---|
817 | // |
---|
818 | // |
---|
819 | // TODO |
---|
820 | // -- make the number of pixels GLOBAL to pick up the right numbers for the detector dimensions |
---|
821 | // x- there will be lots of work to do to develop the procedures necessary to actually generate the |
---|
822 | // 9 data sets to become the MASK file contents. More complexity here than for the simple SANS case. |
---|
823 | // |
---|
824 | // x- this is currently random 0|1 values, need to write an editor |
---|
825 | // |
---|
826 | // currently set up to use 1 = YES MASK == exclude the data |
---|
827 | // and 0 = NO MASK == keep the data |
---|
828 | // |
---|
829 | Proc H_Setup_VSANS_MASK_Structure() |
---|
830 | |
---|
831 | NewDataFolder/O/S root:VSANS_MASK_file |
---|
832 | |
---|
833 | NewDataFolder/O/S root:VSANS_MASK_file:entry |
---|
834 | Make/O/T/N=1 title = "This is a MASK file for VSANS: VSANS_MASK" |
---|
835 | Make/O/T/N=1 start_date = "2015-02-28T08:15:30-5:00" |
---|
836 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument |
---|
837 | Make/O/T/N=1 name = "NG3_VSANS" |
---|
838 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_B |
---|
839 | Make/O/I/N=(680,1656) data = 0 |
---|
840 | data[][0,5] = 1 |
---|
841 | data[][1650,1655] = 1 |
---|
842 | data[0,5][] = 1 |
---|
843 | data[675,679][] = 1 |
---|
844 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_MR |
---|
845 | Make/O/I/N=(48,128) data = 0 |
---|
846 | data[44,47][] = 1 |
---|
847 | data[][0,4] = 1 |
---|
848 | data[][123,127] = 1 |
---|
849 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_ML |
---|
850 | Make/O/I/N=(48,128) data = 0 |
---|
851 | data[0,3][] = 1 |
---|
852 | data[][0,4] = 1 |
---|
853 | data[][123,127] = 1 |
---|
854 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_MT |
---|
855 | Make/O/I/N=(128,48) data = 0 |
---|
856 | data[0,49][] = 1 |
---|
857 | data[78,127][] = 1 |
---|
858 | data[50,77][] = 0 |
---|
859 | |
---|
860 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_MB |
---|
861 | Make/O/I/N=(128,48) data = 0 |
---|
862 | data[0,49][] = 1 |
---|
863 | data[78,127][] = 1 |
---|
864 | data[50,77][] = 0 |
---|
865 | |
---|
866 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FR |
---|
867 | Make/O/I/N=(48,128) data = 0 |
---|
868 | data[44,47][] = 1 |
---|
869 | data[][0,4] = 1 |
---|
870 | data[][123,127] = 1 |
---|
871 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FL |
---|
872 | Make/O/I/N=(48,128) data = 0 |
---|
873 | data[0,3][] = 1 |
---|
874 | data[][0,4] = 1 |
---|
875 | data[][123,127] = 1 |
---|
876 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FT |
---|
877 | Make/O/I/N=(128,48) data = 0 |
---|
878 | data[0,49][] = 1 |
---|
879 | data[78,127][] = 1 |
---|
880 | data[50,77][] = 0 |
---|
881 | |
---|
882 | NewDataFolder/O/S root:VSANS_MASK_file:entry:instrument:detector_FB |
---|
883 | Make/O/I/N=(128,48) data = 0 |
---|
884 | data[0,49][] = 1 |
---|
885 | data[78,127][] = 1 |
---|
886 | data[50,77][] = 0 |
---|
887 | |
---|
888 | |
---|
889 | // fake, empty folders so that the generic loaders can be used |
---|
890 | NewDataFolder/O root:VSANS_MASK_file:entry:DAS_logs |
---|
891 | NewDataFolder/O root:VSANS_MASK_file:entry:control |
---|
892 | NewDataFolder/O root:VSANS_MASK_file:entry:reduction |
---|
893 | NewDataFolder/O root:VSANS_MASK_file:entry:sample |
---|
894 | NewDataFolder/O root:VSANS_MASK_file:entry:user |
---|
895 | SetDataFolder root: |
---|
896 | |
---|
897 | End |
---|
898 | |
---|
899 | |
---|
900 | // this default mask is only generated on startup of the panel, if a mask |
---|
901 | // has not been previously loaded. If any mask is present ("FT" is tested) then |
---|
902 | // this function is skipped and the existing mask is not overwritten |
---|
903 | Function V_GenerateDefaultMask() |
---|
904 | |
---|
905 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry |
---|
906 | Make/O/T/N=1 title = "This is a MASK file for VSANS: VSANS_MASK" |
---|
907 | Make/O/T/N=1 start_date = "2015-02-28T08:15:30-5:00" |
---|
908 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument |
---|
909 | Make/O/T/N=1 name = "NG3_VSANS" |
---|
910 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_B |
---|
911 | Make/O/I/N=(680,1656) data = 0 |
---|
912 | data[][0,5] = 1 |
---|
913 | data[][1650,1655] = 1 |
---|
914 | data[0,5][] = 1 |
---|
915 | data[675,679][] = 1 |
---|
916 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MR |
---|
917 | Make/O/I/N=(48,128) data = 0 |
---|
918 | // data[][0,3] = 1 |
---|
919 | data[44,47][] = 1 |
---|
920 | data[][0,4] = 1 |
---|
921 | data[][123,127] = 1 |
---|
922 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_ML |
---|
923 | Make/O/I/N=(48,128) data = 0 |
---|
924 | data[0,3][] = 1 |
---|
925 | // data[44,47][] = 1 |
---|
926 | data[][0,4] = 1 |
---|
927 | data[][123,127] = 1 |
---|
928 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MT |
---|
929 | Make/O/I/N=(128,48) data = 0 |
---|
930 | data[0,49][] = 1 |
---|
931 | data[78,127][] = 1 |
---|
932 | data[50,77][] = 0 |
---|
933 | |
---|
934 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_MB |
---|
935 | Make/O/I/N=(128,48) data = 0 |
---|
936 | data[0,49][] = 1 |
---|
937 | data[78,127][] = 1 |
---|
938 | data[50,77][] = 0 |
---|
939 | |
---|
940 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FR |
---|
941 | Make/O/I/N=(48,128) data = 0 |
---|
942 | // data[][0,3] = 1 |
---|
943 | data[44,47][] = 1 |
---|
944 | data[][0,4] = 1 |
---|
945 | data[][123,127] = 1 |
---|
946 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FL |
---|
947 | Make/O/I/N=(48,128) data = 0 |
---|
948 | data[0,3][] = 1 |
---|
949 | // data[44,47][] = 1 |
---|
950 | data[][0,4] = 1 |
---|
951 | data[][123,127] = 1 |
---|
952 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FT |
---|
953 | Make/O/I/N=(128,48) data = 0 |
---|
954 | data[0,49][] = 1 |
---|
955 | data[78,127][] = 1 |
---|
956 | data[50,77][] = 0 |
---|
957 | |
---|
958 | NewDataFolder/O/S root:Packages:NIST:VSANS:MSK:entry:instrument:detector_FB |
---|
959 | Make/O/I/N=(128,48) data = 0 |
---|
960 | data[0,49][] = 1 |
---|
961 | data[78,127][] = 1 |
---|
962 | data[50,77][] = 0 |
---|
963 | |
---|
964 | SetDataFolder root: |
---|
965 | |
---|
966 | end |
---|
967 | |
---|
968 | ////////////////////// MASK FILE |
---|
969 | |
---|
970 | |
---|
971 | // (DONE) |
---|
972 | // x- currently, there are no dummy fill values or attributes for the fake MASK file |
---|
973 | // |
---|
974 | Proc Setup_VSANS_MASK_Struct() |
---|
975 | |
---|
976 | // lays out the tree and fills with dummy values |
---|
977 | H_Setup_VSANS_MASK_Structure() |
---|
978 | |
---|
979 | // writes in the attributes |
---|
980 | // H_Fill_VSANS_Attributes() |
---|
981 | |
---|
982 | |
---|
983 | End |
---|
984 | |
---|
985 | Proc Save_VSANS_MASK_Nexus(fileName) |
---|
986 | String fileName="Test_VSANS_MASK_file" |
---|
987 | |
---|
988 | // save as HDF5 (no attributes saved yet) |
---|
989 | Save_VSANS_file("root:VSANS_MASK_file", fileName+".h5") |
---|
990 | |
---|
991 | // // read in a data file using the gateway-- reads from the home path |
---|
992 | // H_HDF5Gate_Read_Raw(fileName+".h5") |
---|
993 | // |
---|
994 | // // after reading in a "partial" file using the gateway (to generate the xref) |
---|
995 | // // Save the xref to disk (for later use) |
---|
996 | // Save_HDF5___xref("root:"+fileName,"HDF5___xref") |
---|
997 | // |
---|
998 | // // after you've generated the HDF5___xref, load it in and copy it |
---|
999 | // // to the necessary folder location. |
---|
1000 | // Copy_HDF5___xref("root:VSANS_MASK_file", "HDF5___xref") |
---|
1001 | // |
---|
1002 | // // writes out the contents of a data folder using the gateway |
---|
1003 | // H_HDF5Gate_Write_Raw("root:VSANS_MASK_file", fileName+".h5") |
---|
1004 | // |
---|
1005 | // // re-load the data file using the gateway-- reads from the home path |
---|
1006 | // // now with attributes |
---|
1007 | // H_HDF5Gate_Read_Raw(fileName+".h5") |
---|
1008 | |
---|
1009 | End |
---|