// Anciently started the threads ...
// Threads now automatically start at first image request
//mReader.Start();
-
+
}
//======================================================================
mReaderStarted=false;
}
//======================================================================
-
+
//======================================================================
/// Finalize
void GimmickView::Finalize()
GimmickError("INTERNAL ERROR : GimmickView::UpdateTreeView : '"
<<t<<"' is not in TreeViewMap");
}
- i->second->UpdateLevel(l);
+ i->second->UpdateLevel(l);
}
//======================================================================
}
//======================================================================
-
+
//======================================================================
bool ImageExtent::IsCompatible(const ImageExtent& ie)
{
}
//======================================================================
-
+
//======================================================================
void ImageExtent::Add(const ImageExtent& ie)
{
///Reads Images (Non Threaded)
void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vector<std::string> im, int dimension)
{
+
+/* remember!
+
+#define GIMMICK_NO_IMAGE_SELECTION 0
+#define GIMMICK_2D_IMAGE_SELECTION 2
+#define GIMMICK_3D_IMAGE_SELECTION 3
+#define GIMMICK_4D_IMAGE_SELECTION 4
+
+#define NATIVE 0
+#define _2D 2
+#define _3D 3
+
+*/
// Create the output data
if (im.size()==1)
- {
+ {
// Only one image : give it
vtkImageData* out = vtkImageData::New();
GimmickDebugMessage(3, "State Check: Full Filename: "
<<std::endl);
out->ShallowCopy(mReader.GetImage(im.front()));
s.push_back( out );
- }
+ }
else if (im.size()>1) // Test inutile ? JPR
{
vtkImageData* first = mReader.GetImage( im.front());
if (dimension == 2)
- {
+ {
// n3D
std::vector<std::string>::iterator it;
for (it=im.begin(); it!=im.end(); ++it)
}
else
{
- // n2D to 3D
+ // n*2D to 3D
vtkImageData* out = vtkImageData::New();
out->CopyStructure(first);
out->SetScalarType(first->GetScalarType());
int ext[6];
//first->GetExtent(ext); // JPR
- first->GetWholeExtent(ext);
+ first->GetWholeExtent(ext); // renvoie egalement 0,0 en Z // JPR
+
std::cout <<"in GimmickView::ReadImagesNotThreaded GetWholeExtent ext =";
for (int jjj=0;jjj<6;jjj++)
std:cout << " [" << jjj << "]=" << ext[jjj];
std::cout << endl;
-
+
if(ext[5] == 0)
{
ext[5] = im.size()-1;
ext[5] = ext[5] * im.size()-1; // to deal with multiframes - JPR
}
out->SetExtent(ext);
+
// LG : TODO : Z Spacing ?
out->AllocateScalars();
int dim[3];
first->GetDimensions(dim);
unsigned long imsize = dim[0] * dim[1];
- imsize = imsize * dim[2] ; // deal with multiframes// JPR
+ imsize = imsize * dim[2] ; // deal with multiframes // JPR
//EED 03-11-2009
imsize = imsize * first->GetScalarSize();
vtkImageData* cur = mReader.GetImage( (*it));
// void* src = cur->GetScalarPointer(0,0,0);
// void* dst = out->GetScalarPointer(0,0,slice);
- memcpy(out->GetScalarPointer(0,0,slice),cur->GetScalarPointer(0,0,0),imsize);
+ memcpy(out->GetScalarPointer(0,0,slice), cur->GetScalarPointer(0,0,0), imsize);
slice++;
}
// CTor
WxGimmickReaderDialog::WxGimmickReaderDialog(wxWindow *parent,
wxWindowID id,
- const std::string i_namedescp ,
- const std::string i_namedb ,
+ const std::string i_namedescp,
+ const std::string i_namedb,
wxString title,
const wxPoint& pos,
const wxSize& size,
- int min_dim,
+ int min_dim,
int max_dim,
- int output_dim,
+ int output_dim, // never used ?!? // JPR
int threads)
: wxDialog( parent,
id,
pos,
size,
wxRESIZE_BORDER |
- wxSYSTEM_MENU |
- wxCLOSE_BOX |
- wxMAXIMIZE_BOX |
- wxMINIMIZE_BOX |
+ wxSYSTEM_MENU |
+ wxCLOSE_BOX |
+ wxMAXIMIZE_BOX |
+ wxMINIMIZE_BOX |
wxCAPTION
),
// mGimmick(0),
GimmickDebugMessage(1,"WxGimmickReaderDialog::WxGimmickReaderDialog"
<<std::endl);
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
-
+
try {
-
- mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
+
+ mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
mGimmick->Initialize(i_namedescp,i_namedb);
-
-
+
mView = new WxGimmickView(mGimmick,
this,
TVID,
mView->Initialize();
// Connect the AddProgress callback
mView->ConnectValidationObserver
- ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) );
+ ( boost::bind( &WxGimmickReaderDialog::OnValid , this, _1 ) );
}
catch (crea::Exception e)
{
topsizer->Add( mView,1,wxGROW,0);
wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK|wxCANCEL);
- mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
- mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
-
+ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
+ mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
+
mOkButton->Enable(false);
topsizer->Add ( bsizer, 0, wxGROW );
<<std::endl);
if (mView)
{
-
- delete mView;
+ delete mView;
}
if (mGimmick)
{
{
mOkButton->Enable(t);
}
-
+
//================================================================
//BEGIN_EVENT_TABLE(WxGimmickReaderDialog, wxDialog)
//END_EVENT_TABLE()
//================================================================
-
} // EO namespace creaImageIO
-