Applications/DTIAtlasFiberAnalyzer/DTIAtlasFiberAnalyzerguiwindow.cxx
/*********************************************************************************
 * Remove the fiber selected from the list
 ********************************************************************************/
Remove the fiber selected from the list
Remove the fiber selected from the list
void DTIAtlasFiberAnalyzerguiwindow::RemoveFiberInList()
{
    if(m_debug)
    {
        std::cout<<"Remove Fibers"<<std::endl;
    }
    QList<QListWidgetItem *> SelectedFiber;
    SelectedFiber = FiberSelectedList->selectedItems();
    std::vector<int> plane;
    for(int i=0;i<SelectedFiber.count();i++)
    {
        for(int j=0;j<FiberSelectedList->count();j++)
        {
            if(((FiberSelectedList->item(j))->text()).compare((SelectedFiber.at(i))->text())==0)
            {
                FiberInAtlasList->addItem(FiberSelectedList->takeItem(j));
                FiberSelected2List->takeItem(j);
                m_Fibername.push_back(((SelectedFiber.at(i))->text()).toStdString());
                plane = PlaneAssociatedToFiber(((SelectedFiber.at(i))->text()).toStdString(), m_RelevantPlane);
                if(plane.size()!=0)
                {
                    for(unsigned int k=0; k<plane.size(); k++)
                    {
                        FiberPlaneFile->takeItem(plane[k]);
                        m_RelevantPlane.erase(m_RelevantPlane.begin()+plane[k]);
                    }
                }
            }
        }
        for(unsigned int k=0;k<m_FiberSelectedname.size();k++)
        {
            if(m_FiberSelectedname[k].compare(((SelectedFiber.at(i))->text()).toStdString())==0)
            {
                m_FiberSelectedname.erase(m_FiberSelectedname.begin()+k);
            }
        }
    }
    CheckNextStep();
}
void DTIAtlasFiberAnalyzerguiwindow :: RemoveFiberInList ( ) { if ( m_debug ) { std :: cout << " " << std :: endl ; } QList < QListWidgetItem * > SelectedFiber ; SelectedFiber = FiberSelectedList -> selectedItems ( ) ; std :: vector < int > plane ; for ( int i = 0 ; i < SelectedFiber . count ( ) ; i ++ ) { for ( int j = 0 ; j < FiberSelectedList -> count ( ) ; j ++ ) { if ( ( ( FiberSelectedList -> item ( j ) ) -> text ( ) ) . compare ( ( SelectedFiber . at ( i ) ) -> text ( ) ) == 0 ) { FiberInAtlasList -> addItem ( FiberSelectedList -> takeItem ( j ) ) ; FiberSelected2List -> takeItem ( j ) ; m_Fibername . push_back ( ( ( SelectedFiber . at ( i ) ) -> text ( ) ) . toStdString ( ) ) ; plane = PlaneAssociatedToFiber ( ( ( SelectedFiber . at ( i ) ) -> text ( ) ) . toStdString ( ) , m_RelevantPlane ) ; if ( plane . size ( ) != 0 ) { for ( unsigned int k = 0 ; k < plane . size ( ) ; k ++ ) { FiberPlaneFile -> takeItem ( plane [ k ] ) ; m_RelevantPlane . erase ( m_RelevantPlane . begin ( ) + plane [ k ] ) ; } } } } for ( unsigned int k = 0 ; k < m_FiberSelectedname . size ( ) ; k ++ ) { if ( m_FiberSelectedname [ k ] . compare ( ( ( SelectedFiber . at ( i ) ) -> text ( ) ) . toStdString ( ) ) == 0 ) { m_FiberSelectedname . erase ( m_FiberSelectedname . begin ( ) + k ) ; } } } CheckNextStep ( ) ; }
Remove the fiber selected from the list
Remove the fiber selected from the list
//remove this from the FiberSelectedList and from the vector //Remove the item /* Plane */ //remove the name in the vector