-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathValueBox.mxml
77 lines (69 loc) · 3.91 KB
/
ValueBox.mxml
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
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" backgroundColor="#FFFFFF" resize="canvas1_resizeHandler(event)" xmlns:ns1="*" mouseOver="canvas1_mouseOverHandler(event)" mouseOut="main.SliceMix.drawAnchor()" xmlns:s="library://ns.adobe.com/flex/spark">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.DataGridEvent;
import mx.events.ResizeEvent;
public var main:QuickNII;
[Bindable] protected var rows:ArrayCollection=new ArrayCollection;
public function initTransformations(transforms:Vector.<NamedTransformation>):void {
rows.addItem(new NamedTransformation("Voxels",1,0,0,0,0,1,0,0,0,0,1,0));
for(var i:int=0;i<transforms.length;i++)
rows.addItem(transforms[i]);
}
public function setVox(x:Number,y:Number,z:Number):void {
for(var i:int=0;i<rows.length;i++)
rows.getItemAt(i).setVox(x,y,z);
}
public function updateFrom(idx:int):void {
const base:NamedTransformation=rows.getItemAt(idx) as NamedTransformation;
main.cut.setlocation(base.voxx,base.voxy,base.voxz);
}
protected function canvas1_resizeHandler(event:ResizeEvent):void {
gray.y=outline.y=decompcfg.y=navilock.y=trfs.y+trfs.height+10;
min.y=height-10-min.height;
max.y=min.y-10-max.height;
min.width=max.width=width-10-10;
}
protected function canvas1_mouseOverHandler(event:MouseEvent):void {
main.SliceMix.drawMidCross();
}
protected function trfs_itemFocusOutHandler(event:DataGridEvent):void {
updateFrom(event.rowIndex);
}
]]>
</mx:Script>
<mx:CheckBox id="gray" label="Grayscale" change="main.refresh()" x="10" selected="true" enabled="false" y="168"/>
<mx:CheckBox id="outline" label="Outline" change="main.refresh()" x="96" y="168"/>
<mx:ComboBox id="decompcfg" x="169" change="main.styleDecomp();main.updateDecomp();MgmtPanel.interpolate()" y="168">
<mx:ArrayList>
<mx:String>Coronal</mx:String>
<mx:String>Sagittal</mx:String>
<mx:String>Horizontal</mx:String>
</mx:ArrayList>
</mx:ComboBox>
<mx:CheckBox x="279" y="168" label="Disable Cut controls" id="navilock" selected="{QuickNII.navilock}" change="QuickNII.navilock=navilock.selected;QuickNII.diz.slicewindow.invalidateDisplayList()"/>
<mx:HSlider id="min" x="10" change="main.refresh()" liveDragging="true"/>
<mx:HSlider id="max" x="10" change="main.refresh()" liveDragging="true"/>
<mx:DataGrid id="trfs" x="10" y="10" editable="true" width="700" sortableColumns="false" itemFocusOut="trfs_itemFocusOutHandler(event)" dataProvider="{rows}" draggableColumns="false">
<mx:columns>
<mx:DataGridColumn dataField="name" sortable="false" headerText="Transformation" editable="false"/>
<mx:DataGridColumn dataField="x" headerText="x"/>
<mx:DataGridColumn dataField="y" headerText="y"/>
<mx:DataGridColumn dataField="z" headerText="z"/>
</mx:columns>
</mx:DataGrid>
<mx:CheckBox x="305" label="R" id="ctrl_R" selected="true" y="196" change="QuickNII.diz.fetchSlice()"/>
<mx:CheckBox x="346" label="G" id="ctrl_G" selected="true" y="196" change="QuickNII.diz.fetchSlice()"/>
<mx:CheckBox x="387" label="B" id="ctrl_B" selected="true" y="196" change="QuickNII.diz.fetchSlice()"/>
<mx:Label x="10" y="200" text="Enable/disable color channels"/>
<mx:Label x="188" y="200" text="Template (volume)"/>
<mx:Label x="188" y="224" text="Image (histology)"/>
<mx:CheckBox x="305" label="R" id="ctrl_R0" selected="true" y="220" change="main.SliceMix.doMagic()"/>
<mx:CheckBox x="346" label="G" id="ctrl_G0" selected="true" y="220" change="main.SliceMix.doMagic()"/>
<mx:CheckBox x="387" label="B" id="ctrl_B0" selected="true" y="220" change="main.SliceMix.doMagic()"/>
<mx:Label x="454" y="222" text="Image darkness (0=auto)"/>
<mx:HSlider x="604" y="218" id="ctrl_S" minimum="0" maximum="255" value="255" snapInterval="1" change="main.SliceMix.doMagic()"/>
<mx:Label x="772" y="222" text="(255=original)"/>
</mx:Canvas>