void mitk::TbssImage::SetDisplayIndexForRendering(int displayIndex) { MITK_INFO << "displayindex: " << displayIndex; int index = displayIndex; int vecLength = m_Image->GetVectorLength(); index = index > vecLength-1 ? vecLength-1 : index; if( m_DisplayIndex != index ) { typedef itk::Image<float,3> ImgType; ImgType::Pointer img = ImgType::New(); CastToItkImage<ImgType>(this, img); itk::ImageRegionIterator<ImgType> itw (img, img->GetLargestPossibleRegion() ); itw = itw.Begin(); itk::ImageRegionConstIterator<ImageType> itr (m_Image, m_Image->GetLargestPossibleRegion() ); itr = itr.Begin(); while(!itr.IsAtEnd()) { itw.Set(itr.Get().GetElement(index)); ++itr; ++itw; } } m_DisplayIndex = index; }
void SMSPlugin::removePhoneCol() { QList<QWidget *> list = QApplication::topLevelWidgets(); QListIterator<QWidget *> it(list); QWidget *w; while ( it.hasNext()){ w = it.next(); QList<QObject *> l = w->queryList("MainInfo"); QListIterator<QObject *> itw(l); QObject * obj; while ( itw.hasNext()) { obj = itw.next(); removePhoneCol(static_cast<MainInfo*>(obj)); } } }
void mitk::TbssImage::InitializeFromVectorImage() { if(!m_Image) { MITK_INFO << "TBSS Image could not be initialized. Set all members first!" << std::endl; return; } typedef itk::Image<float,3> ImgType; ImgType::Pointer img = ImgType::New(); img->SetSpacing( m_Image->GetSpacing() ); // Set the image spacing img->SetOrigin( m_Image->GetOrigin() ); // Set the image origin img->SetDirection( m_Image->GetDirection() ); // Set the image direction img->SetLargestPossibleRegion( m_Image->GetLargestPossibleRegion()); img->SetBufferedRegion( m_Image->GetLargestPossibleRegion() ); img->Allocate(); int vecLength = m_Image->GetVectorLength(); InitializeByItk( img.GetPointer(), 1, vecLength ); //for(int i=0; i<vecLength; i++) //{TbssImage(); itk::ImageRegionIterator<ImgType> itw (img, img->GetLargestPossibleRegion() ); itw = itw.Begin(); itk::ImageRegionConstIterator<ImageType> itr (m_Image, m_Image->GetLargestPossibleRegion() ); itr = itr.Begin(); while(!itr.IsAtEnd()) { itw.Set(itr.Get().GetElement(0)); ++itr; ++itw; } // init SetImportVolume(img->GetBufferPointer());//, 0, 0, CopyMemory); //SetVolume( img->GetBufferPointer(), i ); //}:: m_DisplayIndex = 0; MITK_INFO << "Tbss-Image successfully initialized."; }
double Vector<C>::wrmsqr_norm(const double atol, const double rtol, const Vector<C>& v, const Vector<C>& w) const { assert(size() == w.size()); double result = 0; for (const_iterator it(begin()), itv (v.begin()), itw(w.begin()), itend(end()); it != itend; ++it, ++itv, ++itw) { const double help = *it / (atol + rtol * std::max(*itv, *itw)); result += help * help; } return result == 0 ? 0 : sqrt(result/size()); }
void SMSPlugin::removePhoneCol() { QWidgetList *list = QApplication::topLevelWidgets(); QWidgetListIt it(*list); QWidget *w; while ((w=it.current()) != NULL){ ++it; QObjectList * l = w->queryList("MainInfo"); QObjectListIt itw(*l); QObject * obj; while ((obj=itw.current()) != NULL) { ++itw; removePhoneCol(static_cast<MainInfo*>(obj)); } delete l; } delete list; }