BOX
itk:BinaryThresholdImageFilter:Box02
ISEXEC:FALSE
--37.240041:-147.039576:-900.000000
-33.934959:-157.039576:-900.000000
+16.529723:-124.228161:-900.000000
+87.704723:-134.228161:-900.000000
PORT
InsideValue:"255"
PORT
BOX
vtk:MarchingCubes:Box05
ISEXEC:FALSE
-42.059812:-205.568278:-900.000000
-87.634812:-215.568278:-900.000000
+-52.851969:-223.084186:-900.000000
+-7.276969:-233.084186:-900.000000
PORT
ComputeNormalsOn:"true"
PORT
BOX
vtk:ImageContinuousErode3D:Box06
ISEXEC:FALSE
-55.330546:-148.747823:-900.000000
-126.505546:-158.747823:-900.000000
+-15.547780:-164.634344:-900.000000
+55.627220:-174.634344:-900.000000
PORT
KernelSizeX:"3"
PORT
BOX
vtk:SegmentationConnectivity:Box09
ISEXEC:FALSE
-54.014140:-166.439600:-900.000000
-125.189140:-176.439600:-900.000000
+-22.159693:-183.955508:-900.000000
+49.015307:-193.955508:-900.000000
PORT
PositionXYZ:"73 101 93"
PORT
BOX
wt:ViewerNVWeb:Box12
ISEXEC:FALSE
--101.034885:-197.398691:-900.000000
--55.459885:-207.398691:-900.000000
+-89.221831:-177.846049:-900.000000
+-43.646831:-187.846049:-900.000000
PORT
ImagePath:"imagesTMP/hola.nii"
FIN_BOX
wt:Slider:Box16
ISEXEC:FALSE
-163.108601:-79.545339:-900.000000
--114.788601:-89.545339:-900.000000
+-128.421336:-89.545339:-900.000000
PORT
In:"1500"
PORT
wt:LayoutLine:Box17
ISEXEC:FALSE
-170.375687:-198.734780:-900.000000
--124.012327:-208.734780:-900.000000
+-121.323656:-208.734780:-900.000000
FIN_BOX
BOX
wt:CommandButton:Box21
BOX
vtk:ImageGaussianSmooth:Box29
ISEXEC:FALSE
-51.402317:-187.813911:-900.000000
-122.577317:-197.813911:-900.000000
+-43.509464:-205.329819:-900.000000
+27.665536:-215.329819:-900.000000
PORT
StdDevX:"0"
PORT
wt:Slider:Box31
ISEXEC:FALSE
-78.667210:-47.626578:-900.000000
--30.347210:-57.626578:-900.000000
+-45.892210:-57.626578:-900.000000
PORT
In:"1"
PORT
BOX
wt:AddMeshB:Box37
ISEXEC:FALSE
-38.683815:-225.123788:-900.000000
-84.258815:-235.123788:-900.000000
+-56.227966:-242.639696:-900.000000
+-10.652966:-252.639696:-900.000000
FIN_BOX
BOX
wt:configServerWT:Box38
BOX
wt:LayoutSplit:Box40
ISEXEC:TRUE
--143.571980:-228.411427:-900.000000
--97.996980:-238.411427:-900.000000
+-140.800343:-255.819841:-900.000000
+-95.225343:-265.819841:-900.000000
PORT
Orientation:"h"
FIN_BOX
wt:OutputText:Box25
ISEXEC:FALSE
-200.993777:-157.082523:-900.000000
--155.418777:-167.082523:-900.000000
+-155.145024:-167.082523:-900.000000
PORT
In:"ZOOM to refresh screen"
FIN_BOX
//--------------------------------------------------------------------------------------------------------
void ViewerNVWeb::Process()
{
- printf("EED ViewerNVWeb::Process start\n ");
-
Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget();
- std::string jsCom;
-
- //jsCom = "\
- var volume = new X.volume();\
- volume.spacing = [0.7,0.7,0.7 ];\
- volume.file = '" + bbGetInputImagePath() + "';\
- " +w->jsRef() + ".mVolume = volume;\
- setTimeout(function(){\
- var center = [0,0,0\
- ];\
- " +w->jsRef() + ".mVolume.center = center;\
- volume.center = [0,0,0];\
- " + wtWindow1->jsRef() + ".mRenderer.add(" + w->jsRef() + ".mVolume);\
- " + wtWindow1->jsRef() + ".mRenderer.onShowTime = function(){\
- " + w->jsRef() +".mVolume.upperThreshold =20000;\
- " + w->jsRef() +".mVolume.windowHigh =1670;\
- var gui = new dat.GUI();\
- var volumegui = gui.addFolder('Volume');\
- var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\
- var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1);\
- var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\
- var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\
- var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\
- var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\
- var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\
- " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow2->jsRef() + ".mRenderer.render();\
- " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow3->jsRef() + ".mRenderer.render();\
- " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow4->jsRef() + ".mRenderer.render();\
- };\
- " + wtWindow1->jsRef() + ".mRenderer.render();\
- },500";
-
-
- if (firstTime==false)
+ std::string jsCom;
+printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
+ bool ok;
+ FILE *ff=fopen( bbGetInputImagePath().c_str() , "r" );
+ if (ff)
{
- firstTime=false;
- jsCom = "\
- var volume = new X.volume();\
- volume.spacing = [0.7,0.7,0.7 ];\
- volume.file = '" + bbGetInputImagePath() + "';\
- " +w->jsRef() + ".mVolume = volume;\
- var center = [0,0,0];\
- " +w->jsRef() + ".mVolume.center = center;\
- volume.center = [0,0,0];\
- setTimeout(function(){\
- " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow1->jsRef() + ".mRenderer.render();\
- },300);\
- ";
- w->doJavaScript(jsCom);
- }
+ ok=true;
+ fclose(ff);
+ } else {
+ ok=false;
+ }
- if (firstTime==true)
+ if (ok==true)
{
- firstTime=false;
- jsCom = "\
- var volume = new X.volume();\
- volume.spacing = [0.7,0.7,0.7 ];\
- volume.file = '" + bbGetInputImagePath() + "';\
- " +w->jsRef() + ".mVolume = volume;\
- var center = [0,0,0];\
- " +w->jsRef() + ".mVolume.center = center;\
- volume.center = [0,0,0];\
- setTimeout(function(){\
- " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow1->jsRef() + ".mRenderer.render();\
- },300);\
- setTimeout(function(){\
- " + w->jsRef() +".mVolume.upperThreshold =20000;\
- " + w->jsRef() +".mVolume.windowHigh =1670;\
- var gui = new dat.GUI();\
- var volumegui = gui.addFolder('Volume');\
- var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\
- var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1);\
- var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\
- var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\
- var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\
- var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\
- var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\
- " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow2->jsRef() + ".mRenderer.render();\
- " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow3->jsRef() + ".mRenderer.render();\
- " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow4->jsRef() + ".mRenderer.render();\
- },3000);\
- ";
-
- // jsCom = "\
- var volume = new X.volume();\
- volume.spacing = [0.7,0.7,0.7 ];\
- volume.file = '" + bbGetInputImagePath() + "';\
- " +w->jsRef() + ".mVolume = volume;\
- var center = [0,0,0\
- ];\
- " +w->jsRef() + ".mVolume.center = center;\
- volume.center = [0,0,0];\
- setTimeout(function(){\
- " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- },300);\
- " + wtWindow1->jsRef() + ".mRenderer.onShowTime = function(){\
- " + w->jsRef() +".mVolume.upperThreshold =20000;\
- " + w->jsRef() +".mVolume.windowHigh =1670;\
- var gui = new dat.GUI();\
- var volumegui = gui.addFolder('Volume');\
- var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\
- var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1);\
- var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\
- var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\
- var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\
- var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\
- var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\
- " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow2->jsRef() + ".mRenderer.render();\
- " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow3->jsRef() + ".mRenderer.render();\
- " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
- " + wtWindow4->jsRef() + ".mRenderer.render();\
- };\
- " + wtWindow1->jsRef() + ".mRenderer.render();";
-
- std::cout<<"LOADzzzzzzzzzzzzzzzzzzzzzzzzzzzz"<<jsCom<<std::endl;
+ if (firstTime==false)
+ {
+
+/*
+ jsCom = "\
+ try{\
+ var volume = new X.volume();\
+ volume.spacing = [0.7,0.7,0.7 ];\
+ volume.file = '" + bbGetInputImagePath() + "';\
+ " +w->jsRef() + ".mVolume = volume;\
+ var center = [0,0,0];\
+ " +w->jsRef() + ".mVolume.center = center;\
+ volume.center = [0,0,0];\
+ setTimeout(function(){\
+ " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow1->jsRef() + ".mRenderer.render();\
+ },300);\
+ } catch (err) {\
+ } \
+ ";
+*/
+
+/*
+ jsCom = "\
+ try{\
+ " +w->jsRef() + ".mVolume.file = '" + bbGetInputImagePath() + "';\
+ setTimeout(function(){\
+ " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow1->jsRef() + ".mRenderer.render();\
+ },300);\
+ } catch (err) {\
+ } \
+ ";
+
w->doJavaScript(jsCom);
- }
-
+*/
+
+ }
+
+ if (firstTime==true)
+ {
+ firstTime=false;
+ jsCom = "\
+ try{\
+ var volume = new X.volume();\
+ volume.spacing = [0.7,0.7,0.7 ];\
+ volume.file = '" + bbGetInputImagePath() + "';\
+ " +w->jsRef() + ".mVolume = volume;\
+ var center = [0,0,0];\
+ " +w->jsRef() + ".mVolume.center = center;\
+ volume.center = [0,0,0];\
+ setTimeout(function(){\
+ " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow1->jsRef() + ".mRenderer.render();\
+ },300);\
+ setTimeout(function(){\
+ " + w->jsRef() +".mVolume.upperThreshold =20000;\
+ " + w->jsRef() +".mVolume.windowHigh =1670;\
+ var gui = new dat.GUI();\
+ var volumegui = gui.addFolder('Volume');\
+ var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\
+ var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1);\
+ var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\
+ var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\
+ var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\
+ var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\
+ var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\
+ " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow2->jsRef() + ".mRenderer.render();\
+ " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow3->jsRef() + ".mRenderer.render();\
+ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow4->jsRef() + ".mRenderer.render();\
+ },3000);\
+ } catch(err) { \
+ } \
+ ";
+
+ // jsCom = "\
+ var volume = new X.volume();\
+ volume.spacing = [0.7,0.7,0.7 ];\
+ volume.file = '" + bbGetInputImagePath() + "';\
+ " +w->jsRef() + ".mVolume = volume;\
+ var center = [0,0,0\
+ ];\
+ " +w->jsRef() + ".mVolume.center = center;\
+ volume.center = [0,0,0];\
+ setTimeout(function(){\
+ " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ },300);\
+ " + wtWindow1->jsRef() + ".mRenderer.onShowTime = function(){\
+ " + w->jsRef() +".mVolume.upperThreshold =20000;\
+ " + w->jsRef() +".mVolume.windowHigh =1670;\
+ var gui = new dat.GUI();\
+ var volumegui = gui.addFolder('Volume');\
+ var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\
+ var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1);\
+ var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\
+ var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\
+ var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\
+ var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\
+ var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\
+ " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow2->jsRef() + ".mRenderer.render();\
+ " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow3->jsRef() + ".mRenderer.render();\
+ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+ " + wtWindow4->jsRef() + ".mRenderer.render();\
+ };\
+ " + wtWindow1->jsRef() + ".mRenderer.render();";
+
+ w->doJavaScript(jsCom);
+ } //if firsttime == true
+ } // ok
//Wt::WApplication::instance()->refresh();
// wtWindow2->resize(Wt::WLength::Auto, 200);
Wt::WApplication::instance()->refresh();
-
- printf("EED ViewerNVWeb::Process END\n ");
-
}