}
if(!gimmickfound || !usegimmick){
- //int i, j, k, *extint;
+ //int i, j, k, extint[6];
+ //double spacing[3];
//unsigned short* ptr1, *ptr2;
wxFileDialog* FD =
new wxFileDialog( 0, _T("Read Image"),wxEmptyString,wxEmptyString, _T("*.mhd"));
reader->Update();
img = vtkImageData::New();
img->DeepCopy(reader->GetOutput());
+ //reader->GetOutput()->Delete();
reader->Delete();
- /*img->SetSpacing(reader->GetOutput()->GetSpacing());
- extint = reader->GetOutput()->GetExtent();
+ /*std::cout<<"image reference count "<<img->GetReferenceCount()<<std::endl;
+ reader->GetOutput()->GetSpacing(spacing);
+ img->SetSpacing(spacing);
+ reader->GetOutput()->GetExtent(extint);
img->SetExtent(extint);
- img->SetScalarType(reader->GetOutput()->GetScalarType());
- img->SetDimensions(reader->GetOutput()->GetDimensions());
+ img->SetScalarType(reader->GetOutput()->GetScalarType());
img->AllocateScalars();
+ std::cout<<"image reference count "<<img->GetReferenceCount()<<std::endl;
for (i=extint[0];i <= extint[1];i++){
for (j=extint[2];j<=extint[3];j++){
for (k=extint[4];k<=extint[5];k++){
*ptr2 = *ptr1;
}
}
- }*/
+ }*/
+
+ std::cout<<"image reference count "<<img->GetReferenceCount()<<std::endl;
}
//delete FD;
}
//-------------------------------------------------------------------
OpenImageDialog::~OpenImageDialog()
{
- img = NULL;
+ img = NULL;
}
vtkImageData* OpenImageDialog::getImageData(){
Program: wxMaracas
Module: $RCSfile: wxMaracas_N_ViewersWidget.cxx,v $
Language: C++
- Date: $Date: 2010/03/25 08:50:32 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2010/03/26 14:52:24 $
+ Version: $Revision: 1.16 $
Copyright: (c) 2002, 2003
License:
delete mvtkmprbasedata;
}
- /*marImageData *marimagedata = new marImageData( imagedata );
+ marImageData *marimagedata = new marImageData( imagedata );
mvtkmprbasedata = new vtkMPRBaseData();
- mvtkmprbasedata->SetMarImageData(marimagedata);*/
+ mvtkmprbasedata->SetMarImageData(marimagedata);
if(_currentwxw != NULL){
_currentwxw->Show(false);
//std::cout<<"size "<<nTypeView->size()<<std::endl;
if (nTypeView->size()==1)
{
- wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0]);
+ wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0], mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow = wxwindow1;
}else if (nTypeView->size()==2) {
wxSplitterWindow *spliter = new wxSplitterWindow( this , -1);
spliter->SetMinimumPaneSize(1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1]);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0], mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1], mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
spliter -> SplitVertically( wxwindow1 , wxwindow2 );
wxSplitterWindow *spliterA = new wxSplitterWindow( spliter , -1);
spliter->SetMinimumPaneSize(1);
spliterA->SetMinimumPaneSize(1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1]);
- wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2]);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0], mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata);
+ wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
wxwindow3->ConfigureVTK();
spliter->SetMinimumPaneSize(1);
spliterA->SetMinimumPaneSize(1);
spliterB->SetMinimumPaneSize(1);
- wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0]);
- wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1]);
- wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2]);
- wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3]);
+ wxwindow1 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[0], mvtkmprbasedata);
+ wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata);
+ wxwindow3 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[2], mvtkmprbasedata);
+ wxwindow4 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[3], mvtkmprbasedata);
wxwindow1->ConfigureVTK();
wxwindow2->ConfigureVTK();
wxwindow3->ConfigureVTK();