<process>
<PRE>
-printf("EED ImagesChooserDialogBox Start\n");
-
// creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database");
creaImageIO::WxSimpleDlg *dlg = new creaImageIO::WxSimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database");
dlg->SetAttrDicomTags( bbGetInputDicomTags() );
bbSignalOutputModification( );
delete dlg;
-printf("EED ImagesChooserDialogBox END \n");
-
</PRE>
</process>
//=====================================================================
vtkImageData* DicomImageReader::ReadImage(const std::string& filename)
{
-printf("EED DicomImageReader::ReadImage Start\n");
vtkImageData* im = 0;
try
{
-printf("EED DicomImageReader::ReadImage 1\n");
mReader->SetFileName(filename.c_str());
-printf("EED DicomImageReader::ReadImage 2 aaaaaaaaaaaaaaaaaaaaaaaaaaa\n");
mReader->Update();
-printf("EED DicomImageReader::ReadImage 3 bbbbbbbbbbbbbbbbbbbbbbbbbbb\n");
im = vtkImageData::New();
-printf("EED DicomImageReader::ReadImage 4\n");
im->ShallowCopy(mReader->GetOutput());
-printf("EED DicomImageReader::ReadImage 5\n");
} catch (...) {
-printf("EED DicomImageReader::ReadImage 6\n");
if (im!=0) im->Delete();
im = 0;
}
-printf("EED DicomImageReader::ReadImage End\n");
return im;
}
//////////////////////////////////////////////////////////
bool GimmickView::isSingle(const std::string i_file)
{
-printf("EED GimmickView::isSingle Start %s\n" , i_file.c_str() );
bool bres = true;
vtkImageData* first = mReader.GetImage( i_file);
-printf("EED GimmickView::isSingle 1\n" );
int dim[3];
first->GetDimensions(dim);
if (dim[2] > 1)
else
{
}
-printf("EED GimmickView::isSingle end\n");
-
return bres;
}
// Returns true iff the file is readable
bool ImageReader::CanRead( const std::string& filename )
{
-printf("EED ImageReader::CanRead Start\n");
bool ok = false;
{
mLastFilename = filename;
mLastReader = *i;
-printf("EED ImageReader::CanRead %s\n",mLastReader->GetName().c_str());
break;
}
}
}
-if (ok==true) printf("EED ImageReader::CanRead true End\n");
-if (ok==false) printf("EED ImageReader::CanRead false End\n");
return ok;
}
//=====================================================================
// Reads the file (CanRead must be called before : no test here)
vtkImageData* ImageReader::ReadImage( const std::string& filename)
{
-printf("EED ImageReader::ReadImage Start\n");
if (mLastFilename!=filename)
{
-printf("EED ImageReader::ReadImage 1\n");
if (!CanRead(filename))
{
-printf("EED ImageReader::ReadImage 2\n");
vtkImageData* im = vtkImageData::New();
im->ShallowCopy(mUnreadableImage);
-printf("EED ImageReader::ReadImage END2\n");
return im;
} // CanRead
} // for mLastFilename
-printf("EED ImageReader::ReadImage 3\n");
vtkImageData* i = mLastReader->ReadImage(mLastFilename);
-printf("EED ImageReader::ReadImage 4\n");
if (i==NULL)
{
i = vtkImageData::New();
i->ShallowCopy(mUnreadableImage);
} // i
-printf("EED ImageReader::ReadImage END1\n");
return i;
}
vtkImageData* MultiThreadImageReader::GetImage(const std::string& filename)
{
- printf("EED MultiThreadImageReader::GetImage Start\n");
-
-
do
{
// wxMutexLocker lock(GetMultiThreadImageReaderUserMutex()); //mMutex);
// if (mThreadedImageReaderList.size()==0)
if (true)
{
- printf("EED MultiThreadImageReader::GetImage 1\n");
ImageToLoad itl(this,filename);
- printf("EED MultiThreadImageReader::GetImage 2\n");
ImageMapType::iterator i = mImages.find(&itl);
if (i!=mImages.end())
{
- printf("EED MultiThreadImageReader::GetImage 2.1\n");
ImageToLoadPtr pitl = const_cast<ImageToLoadPtr>(i->first);
- printf("EED MultiThreadImageReader::GetImage 2.2\n");
// Already inserted
if (pitl->GetImage() != NULL)
{
} // if pitl->GetImage()
} // if i
- printf("EED MultiThreadImageReader::GetImage 3.1\n");
ImageToLoadPtr pitl = new ImageToLoad(this,filename,0);
- printf("EED MultiThreadImageReader::GetImage 3.2\n");
mImages[pitl] = NULL;
pitl->SetImage( mReader->ReadImage(filename) );
- printf("EED MultiThreadImageReader::GetImage 3.3\n");
UpdateUnloadPriority( pitl, GetMaximalPriorityWithoutLocking()+1 );
- printf("EED MultiThreadImageReader::GetImage 3.4\n");
return pitl->GetImage();
} // if true
while (true);
//
*/
- printf("EED MultiThreadImageReader::GetImage END\n");
}
//=====================================================================
void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr,
bool mult, const std::string out_model)
{
-printf("EED WxGimmickView::getSelectedFiles Start\n");
-
// First we select the files
std::vector<std::string> files;
-printf("EED WxGimmickView::getSelectedFiles 1.1\n");
std::string db_name = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
-printf("EED WxGimmickView::getSelectedFiles 1.2\n");
GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);
-printf("EED WxGimmickView::getSelectedFiles 1.3\n");
std::string asking;
std::string dim;
-printf("EED WxGimmickView::getSelectedFiles 1.3.1\n");
bool bsingle = isSingle( files.front() );
-printf("EED WxGimmickView::getSelectedFiles 1.3.2\n");
int i_dim_out;
-printf("EED WxGimmickView::getSelectedFiles 1.4\n");
mGimmick->GetSetting(SETTINGS_OUTPUT_ASK, asking);
-printf("EED WxGimmickView::getSelectedFiles 1.5\n");
mGimmick->GetSetting(SETTINGS_OUTPUT_DIM, dim);
-printf("EED WxGimmickView::getSelectedFiles 1.6\n");
-
if (asking == "true")
{
// display the output dialog box
// get dim
int idim;
sscanf(dim.c_str(),"%d",&idim);
-printf("EED WxGimmickView::getSelectedFiles 1.7\n");
WxOutputDlg *dlg = new WxOutputDlg(this,files, idim -1, bsingle);
-printf("EED WxGimmickView::getSelectedFiles 1.8\n");
if (dlg->ShowModal() == wxID_OK)
{
dim = dlg->getDim();
}
sscanf(dim.c_str(),"%d",&i_dim_out);
-printf("EED WxGimmickView::getSelectedFiles 2\n");
-
-
// Next we create the structure for dicom output infos
OutputAttr Oattr;
//EED 01/09/2014
// Now we read and create the waiting output (vtkImageData * or OutGimmickData *)
readImages(outG, sort_files, Oattr, i_dim_out, zspacing);
-printf("EED WxGimmickView::getSelectedFiles End\n");
-
}
{
dlg.stopReading();
std::vector<creaImageIO::OutStrGimmick> outStrGimmick;
-printf("EED WxSimpleDlg::OnReadGimmick 1 \n");
dlg.getSelected(outStrGimmick, m_attrDicomTags,true,"");
-printf("EED WxSimpleDlg::OnReadGimmick 2 \n");
m_results.clear();
int size=(int)outStrGimmick.size();
int ii;