Applications/DTIAtlasFiberAnalyzer/DTIAtlasFiberAnalyzerguiwindow.cxx
/*********************************************************************************
 * Add the fiber selected into the list
 ********************************************************************************/
Add the fiber selected into the list
Add the fiber selected into the list
void DTIAtlasFiberAnalyzerguiwindow::AddFiberInList()
{
    if(m_debug)
    {
        std::cout<<"Add Fibers"<<std::endl;
    }
    QList<QListWidgetItem *> SelectedFiber;
    SelectedFiber = FiberInAtlasList->selectedItems();
    std::vector<int> plane;
    for(int i=0;i<SelectedFiber.count();i++)
    {
        for(int j=0;j<FiberInAtlasList->count();j++)
        {
            if(((FiberInAtlasList->item(j))->text()).compare((SelectedFiber.at(i))->text())==0)
            {
                QListWidgetItem* item = new QListWidgetItem;
                QString qs((SelectedFiber.at(i))->text());
                item->setData( 0, qs );
                FiberSelectedList->addItem(FiberInAtlasList->takeItem(j));
                FiberSelected2List->addItem(item);
                m_FiberSelectedname.push_back(((SelectedFiber.at(i))->text()).toStdString());
                plane = PlaneAssociatedToFiber(((SelectedFiber.at(i))->text()).toStdString(), m_Fibersplane);
                if(plane.size()!=0)
                {
                    for(unsigned int k=0; k<plane.size(); k++)
                    {
                        m_RelevantPlane.push_back(m_Fibersplane[plane[k]]);
                        QListWidgetItem* itemplane= new QListWidgetItem;
                        QString qs(m_Fibersplane[plane[k]].c_str());
                        itemplane->setData( 0, qs );
                        FiberPlaneFile->addItem(itemplane);
                    }
                }
            }
        }
    }
    for(int i=0; i<FiberPlaneFile->count(); i++)
    {
        FiberPlaneFile->item(i)->setSelected(true);
    }
    CheckNextStep();
}
void DTIAtlasFiberAnalyzerguiwindow :: AddFiberInList ( ) { if ( m_debug ) { std :: cout << " " << std :: endl ; } QList < QListWidgetItem * > SelectedFiber ; SelectedFiber = FiberInAtlasList -> selectedItems ( ) ; std :: vector < int > plane ; for ( int i = 0 ; i < SelectedFiber . count ( ) ; i ++ ) { for ( int j = 0 ; j < FiberInAtlasList -> count ( ) ; j ++ ) { if ( ( ( FiberInAtlasList -> item ( j ) ) -> text ( ) ) . compare ( ( SelectedFiber . at ( i ) ) -> text ( ) ) == 0 ) { QListWidgetItem * item = new QListWidgetItem ; QString qs ( ( SelectedFiber . at ( i ) ) -> text ( ) ) ; item -> setData ( 0 , qs ) ; FiberSelectedList -> addItem ( FiberInAtlasList -> takeItem ( j ) ) ; FiberSelected2List -> addItem ( item ) ; m_FiberSelectedname . push_back ( ( ( SelectedFiber . at ( i ) ) -> text ( ) ) . toStdString ( ) ) ; plane = PlaneAssociatedToFiber ( ( ( SelectedFiber . at ( i ) ) -> text ( ) ) . toStdString ( ) , m_Fibersplane ) ; if ( plane . size ( ) != 0 ) { for ( unsigned int k = 0 ; k < plane . size ( ) ; k ++ ) { m_RelevantPlane . push_back ( m_Fibersplane [ plane [ k ] ] ) ; QListWidgetItem * itemplane = new QListWidgetItem ; QString qs ( m_Fibersplane [ plane [ k ] ] . c_str ( ) ) ; itemplane -> setData ( 0 , qs ) ; FiberPlaneFile -> addItem ( itemplane ) ; } } } } } for ( int i = 0 ; i < FiberPlaneFile -> count ( ) ; i ++ ) { FiberPlaneFile -> item ( i ) -> setSelected ( true ) ; } CheckNextStep ( ) ; }
Add the fiber selected into the list
Add the fiber selected into the list
//add this in the FiberSelectedList and in the vector //Remove and add the item in the List and vector /* Check the plane and add/erase it */