# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY.bbg
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY.bbg
# ----------------------------------
APP_START
AUTHOR:Author ??
COMPLEXBOX:FALSE
COMPLEXINPUTS:0
-BOXES:7
+BOXES:17
BOX
creaMaracasVisu:ViewerNV:Box01
ISEXEC:FALSE
-50.383173:32.032968:-900.000000
-111.023173:22.032968:-900.000000
+79.866200:50.067798:-900.000000
+140.506200:40.067798:-900.000000
FIN_BOX
BOX
vtk:LoadHola:Box02
ISEXEC:FALSE
-22.231304:70.181477:-900.000000
-67.806304:60.181477:-900.000000
+55.791771:86.177587:-900.000000
+101.366771:76.177587:-900.000000
FIN_BOX
BOX
wx:LayoutTab:Box04
ISEXEC:FALSE
--17.670654:-30.060089:-900.000000
-39.889346:-40.060089:-900.000000
+-33.721024:-109.351051:-900.000000
+23.838976:-119.351051:-900.000000
FIN_BOX
BOX
wx:LayoutSplit:Box05
ISEXEC:TRUE
-78.616470:-67.713286:-900.000000
-124.191470:-77.713286:-900.000000
+76.915956:-140.803447:-900.000000
+122.490956:-150.803447:-900.000000
PORT
Orientation:"H"
FIN_BOX
BOX
itk:ImageReader:Box06
ISEXEC:FALSE
--35.424377:73.221521:-900.000000
-10.150623:63.221521:-900.000000
+-45.304327:88.276684:-900.000000
+0.270673:78.276684:-900.000000
PORT
In:"/tmpEED/tmpIulia/coeur_t1_VGpost_z1_pag0001_USHORT_spc-tmpEED.mhd"
FIN_BOX
BOX
vtk:vtkImageDataPointerRelay:Box07
ISEXEC:FALSE
--2.184398:50.126177:-900.000000
-68.990602:40.126177:-900.000000
+57.565779:70.670201:-900.000000
+128.740779:60.670201:-900.000000
FIN_BOX
BOX
creaMaracasVisu:Ruler01_XY_Widget:Box09
ISEXEC:FALSE
-39.925354:-6.480031:-900.000000
-85.500354:-16.480031:-900.000000
+50.863528:26.572260:-900.000000
+96.438528:16.572260:-900.000000
FIN_BOX
-CONNECTIONS:9
+BOX
+creaMaracasVisu:PanelButtonContainerSettings:Box10
+ISEXEC:FALSE
+-57.656044:-17.197832:-900.000000
+13.518956:-27.197832:-900.000000
+PORT
+ButtonDescription:"Ruler 01"
+PORT
+ButtonName:"Ruler 01"
+PORT
+GroupName:"Ruler"
+FIN_BOX
+BOX
+creaMaracasVisu:PanelButtonContainer:Box11
+ISEXEC:FALSE
+-79.899600:-82.362357:-900.000000
+-8.724600:-92.362357:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ContourControlPoints_Widget:Box13
+ISEXEC:FALSE
+114.360380:24.301866:-900.000000
+185.535380:14.301866:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box14
+ISEXEC:TRUE
+116.103305:-6.968508:-900.000000
+161.678305:-16.968508:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:PanelButtonContainerSettings:Box15
+ISEXEC:FALSE
+-68.845012:-53.380556:-900.000000
+2.329988:-63.380556:-900.000000
+PORT
+ButtonDescription:"Ruler 02"
+PORT
+ButtonName:"Ruler 02"
+PORT
+GroupName:"Ruler"
+FIN_BOX
+BOX
+toolsbbtk:ImageVtkPropertiesWidget:Box16
+ISEXEC:FALSE
+-23.191903:52.199106:-900.000000
+47.983097:42.199106:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:PanelButtonContainerSettings:Box17
+ISEXEC:FALSE
+-47.001046:11.642034:-900.000000
+24.173954:1.642034:-900.000000
+PORT
+ButtonDescription:"Image properties"
+PORT
+ButtonName:"Image properties"
+PORT
+GroupName:"Information"
+FIN_BOX
+BOX
+wx:LayoutLine:Box18
+ISEXEC:FALSE
+-117.896873:-16.920169:-900.000000
+-60.336873:-26.920169:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box19
+ISEXEC:FALSE
+-111.282956:11.161994:-900.000000
+-53.722956:1.161994:-900.000000
+FIN_BOX
+BOX
+std:MagicBox:Box20
+ISEXEC:FALSE
+-120.177863:-52.869017:-900.000000
+-74.602863:-62.869017:-900.000000
+FIN_BOX
+CONNECTIONS:22
CONNECTION
Box04:Widget:Box05:Widget1
NumberOfControlPoints:0
Box01:Point:Box09:Point
NumberOfControlPoints:0
CONNECTION
-Box01:Renderer4:Box09:vtkRenderer
+Box02:Out:Box07:In
NumberOfControlPoints:0
CONNECTION
-Box09:Widget:Box04:Widget1
+Box11:Widget:Box04:Widget1
NumberOfControlPoints:0
CONNECTION
-Box02:Out:Box07:In
+Box09:Widget:Box10:Widget
+NumberOfControlPoints:0
+CONNECTION
+Box01:Renderer4:Box13:vtkRenderer
+NumberOfControlPoints:0
+CONNECTION
+Box01:wxVtkBaseView4:Box13:wxvtkbaseview
+NumberOfControlPoints:0
+CONNECTION
+Box13:BoxChange2:Box14:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget_Contour:Box15:Widget
+NumberOfControlPoints:0
+CONNECTION
+Box15:Out:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box15:In
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box16:in
+NumberOfControlPoints:0
+CONNECTION
+Box16:widget:Box17:Widget
+NumberOfControlPoints:0
+CONNECTION
+Box10:Widget:Box18:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box17:Widget:Box19:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box10:In
+NumberOfControlPoints:0
+CONNECTION
+Box15:Widget:Box20:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:Renderer4:Box09:vtkRenderer
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /home/davila/Creatis/All/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY.bbs
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY.bbs
# ----------------------------------
# BBTK GEditor Script
include vtk
include wx
include itk
+include std
+include toolsbbtk
author "Author ??"
description "Description ??"
new Ruler01_XY_Widget Box09
+new PanelButtonContainerSettings Box10
+ set Box10.ButtonDescription "Ruler 01"
+ set Box10.ButtonName "Ruler 01"
+ set Box10.GroupName "Ruler"
+
+new PanelButtonContainer Box11
+
+new ContourControlPoints_Widget Box13
+
+new MagicBox Box14
+
+new PanelButtonContainerSettings Box15
+ set Box15.ButtonDescription "Ruler 02"
+ set Box15.ButtonName "Ruler 02"
+ set Box15.GroupName "Ruler"
+
+new ImageVtkPropertiesWidget Box16
+
+new PanelButtonContainerSettings Box17
+ set Box17.ButtonDescription "Image properties"
+ set Box17.ButtonName "Image properties"
+ set Box17.GroupName "Information"
+
+new LayoutLine Box18
+
+new LayoutLine Box19
+
+new MagicBox Box20
+
connect Box04.Widget Box05.Widget1
connect Box01.Point Box09.Point
-connect Box01.Renderer4 Box09.vtkRenderer
+connect Box02.Out Box07.In
-connect Box09.Widget Box04.Widget1
+connect Box11.Widget Box04.Widget1
-connect Box02.Out Box07.In
+connect Box09.Widget Box10.Widget
+
+connect Box01.Renderer4 Box13.vtkRenderer
+
+connect Box01.wxVtkBaseView4 Box13.wxvtkbaseview
+
+connect Box13.BoxChange2 Box14.BoxExecute
+
+connect Box13.Widget_Contour Box15.Widget
+
+connect Box15.Out Box11.In
+
+connect Box10.Out Box15.In
+
+connect Box07.Out Box16.in
+
+connect Box16.widget Box17.Widget
+
+connect Box10.Widget Box18.Widget1
+
+connect Box17.Widget Box19.Widget1
+
+connect Box17.Out Box10.In
+
+connect Box15.Widget Box20.In
+
+connect Box01.Renderer4 Box09.vtkRenderer
# Complex input ports
exec Box05
+exec Box14
In4:"p) "
PORT
In5:" ang="
+PORT
+In7:" ."
FIN_BOX
BOX
std:Mul:Box17
set Box16.In2 "u ("
set Box16.In4 "p) "
set Box16.In5 " ang="
+ set Box16.In7 " ."
new Mul Box17
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#include "bbcreaMaracasVisuChangeInformationPoint3Dto2D.h"
+#include "bbcreaMaracasVisuPackage.h"
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ChangeInformationPoint3Dto2D)
+BBTK_BLACK_BOX_IMPLEMENTATION(ChangeInformationPoint3Dto2D,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ChangeInformationPoint3Dto2D::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+// Here we simply set the input 'In' value to the output 'Out'
+// And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+// void bbSet{Input|Output}NAME(const TYPE&)
+// const TYPE& bbGet{Input|Output}NAME() const
+// Where :
+// * NAME is the name of the input/output
+// (the one provided in the attribute 'name' of the tag 'input')
+// * TYPE is the C++ type of the input/output
+// (the one provided in the attribute 'type' of the tag 'input')
+
+
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ChangeInformationPoint3Dto2D::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+
+// bbSetInputIn(0);
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ChangeInformationPoint3Dto2D::bbUserInitializeProcessing()
+{
+
+// THE INITIALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should allocate the internal/output pointers
+// if any
+
+
+}
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+void ChangeInformationPoint3Dto2D::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
--- /dev/null
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+#ifndef __bbcreaMaracasVisuChangeInformationPoint3Dto2D_h_INCLUDED__
+#define __bbcreaMaracasVisuChangeInformationPoint3Dto2D_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "wxVtkBaseView.h"
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT ChangeInformationPoint3Dto2D
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ChangeInformationPoint3Dto2D,bbtk::AtomicBlackBox);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+ BBTK_DECLARE_INPUT(InPoint,std::vector<double>);
+ BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
+ BBTK_DECLARE_OUTPUT(OutPoint,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(NormalVector,std::vector<double>);
+ BBTK_PROCESS(Process);
+ void Process();
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ChangeInformationPoint3Dto2D,bbtk::AtomicBlackBox);
+ BBTK_NAME("ChangeInformationPoint3Dto2D");
+ BBTK_AUTHOR("Info-Dev Creatis");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+
+ BBTK_INPUT(ChangeInformationPoint3Dto2D,InPoint,"Input Point 3D",std::vector<double>,"");
+ BBTK_INPUT(ChangeInformationPoint3Dto2D,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
+
+ BBTK_OUTPUT(ChangeInformationPoint3Dto2D,OutPoint,"Output Point 2D",std::vector<double>,"");
+ BBTK_OUTPUT(ChangeInformationPoint3Dto2D,NormalVector,"NormalVector (default 0 0 1)",std::vector<double>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ChangeInformationPoint3Dto2D);
+//=====
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//=====
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuChangeInformationPoint3Dto2D_h_INCLUDED__
+
//------------------------------------------------
void HistogramView::Process()
{
+printf("EED HistogramView::Process Start \n");
if (firsttime==true){
firsttime=false;
// histogram_wxwidget = new Histogram( wxpanel , -1, wxPoint(0,0), wxSize(400,400),wxNO_BORDER );
histogram_wxwidget->Configure( bbGetInputIn() );
}
+printf("EED HistogramView::Process End \n");
}
//------------------------------------------------
{
//setting image data of the points
points->SetDimensions(xDimension,1,1);
- points->SetScalarTypeToUnsignedShort();
+//EED points->SetScalarTypeToUnsignedShort();
+ points->SetScalarTypeToShort();
points->AllocateScalars();
points->Update();
}
/*
Pointers
*/
- unsigned short* dataImagePointer=NULL;
- unsigned short* dataHistogramPointer=NULL;
+ unsigned short* dataImagePointerUS = NULL;
+ short* dataImagePointerS = NULL;
+ double* dataImagePointerD = NULL;
- dataImagePointer=(unsigned short*)imageData->GetScalarPointer(0,0,0);
- dataHistogramPointer=(unsigned short*)points->GetScalarPointer(0,0,0);
+ short* dataHistogramPointer = NULL;
+
+ dataImagePointerUS = (unsigned short*)imageData->GetScalarPointer(0,0,0);
+ dataImagePointerS = (short*)imageData->GetScalarPointer(0,0,0);
+ dataImagePointerD = (double*)imageData->GetScalarPointer(0,0,0);
+
+ dataHistogramPointer = (short*)points->GetScalarPointer(0,0,0);
/*
Range of greys
/*
Setting the minimun and maximum levels of grey
*/
- maxLevelOfGrey=(int)range[1];
- minLevelOfGrey=(int)range[0];
+ maxLevelOfGrey=range[1];
+ minLevelOfGrey=range[0];
//std::cout<<"maxLevelOfGrey "<<maxLevelOfGrey<<" minLevelOfGrey "<<minLevelOfGrey<<std::endl;
/*
Image Size
*/
//double p=((float)*dataImagePointer-minLevelOfGrey);
//j=p*k;
-
- j=getIndex(*dataImagePointer);
+ if (imageData->GetScalarType()==VTK_UNSIGNED_SHORT)
+ {
+ j=getIndex(*dataImagePointerUS);
+ dataImagePointerUS++;
+ }
+ if (imageData->GetScalarType()==VTK_SHORT)
+ {
+ j=getIndex(*dataImagePointerS);
+ dataImagePointerS++;
+ }
+ if (imageData->GetScalarType()==VTK_DOUBLE)
+ {
+ j=getIndex(*dataImagePointerD);
+ dataImagePointerD++;
+ }
+//EED j=getIndex(*dataImagePointer);
+
//std::cout<<j<<std::endl;
dataHistogramPointer[j]++;
- dataImagePointer++;
}
/*
BORRAME
image
@gValue: Level of grey for which wants the index in the histogrram
*/
-int pHistogram::getIndex(int gValue)
+int pHistogram::getIndex(double gValue)
{
double p=((double)gValue-minLevelOfGrey)/(maxLevelOfGrey-minLevelOfGrey);
hash por getting the index for the histogram vector of the original
image
*/
- int getIndex(int gValue);
+ int getIndex(double gValue);
/*
Setting the size
*/
/*
Maximum Level of grey
*/
- int maxLevelOfGrey;
+ double maxLevelOfGrey;
/*
Minimum Level of grey
*/
- int minLevelOfGrey;
+ double minLevelOfGrey;
/*
image size
*/
- int sizeImage;
+ long int sizeImage;
//DECLARE_CLASS (pHistogram)
};