Applications/DTIAtlasFiberAnalyzer/DTIAtlasFiberAnalyzerguiwindow.cxx
/* Set Name for cases column number */
Set Name for cases column number
Set Name for cases column number
void DTIAtlasFiberAnalyzerguiwindow::SetNameColumn()
{
    if(ColumnNameCases->text().toInt() - 1 < CSVtable->columnCount() && ColumnNameCases->text().toInt()!=0
            && ColumnNameCases->text().toInt()>0)
    {
        DecolorCol(3);
        m_NameCol = ColumnNameCases->text().toInt() -1;
        if(m_NameCol==m_DeformationCol)
        {
            m_DeformationCol = -1;
            ColumnDeformation->setText("");
            DecolorCol(2);
        }
        else if(m_NameCol==m_DataCol)
        {
            m_DataCol = -1;
            ColumnData->setText("");
            DecolorCol(1);
        }
        ColorCol(3);
        for(int i=0;i<CSVtable->rowCount();i++)
        {
            if( !CSVtable->item(i,m_NameCol)
                    || !(CSVtable->item(i,m_NameCol))->text().compare("")
                    || !(CSVtable->item(i,m_NameCol))->text().compare("no")
                    )
            {
                QTableWidgetItem *item=  new QTableWidgetItem;
                QString str("no name");
                item->setData( 0, str);
                CSVtable->setItem(i,m_NameCol,item);
            }
        }
    }
    else if((ColumnNameCases->text()).compare("")==0)
    {
        DecolorCol(3);
        m_NameCol = -1;
    }
    else
    {
        ColumnNameCases->setText("");
    }
}
void DTIAtlasFiberAnalyzerguiwindow :: SetNameColumn ( ) { if ( ColumnNameCases -> text ( ) . toInt ( ) - 1 < CSVtable -> columnCount ( ) && ColumnNameCases -> text ( ) . toInt ( ) != 0 && ColumnNameCases -> text ( ) . toInt ( ) > 0 ) { DecolorCol ( 3 ) ; m_NameCol = ColumnNameCases -> text ( ) . toInt ( ) - 1 ; if ( m_NameCol == m_DeformationCol ) { m_DeformationCol = -1 ; ColumnDeformation -> setText ( " " ) ; DecolorCol ( 2 ) ; } else if ( m_NameCol == m_DataCol ) { m_DataCol = -1 ; ColumnData -> setText ( " " ) ; DecolorCol ( 1 ) ; } ColorCol ( 3 ) ; for ( int i = 0 ; i < CSVtable -> rowCount ( ) ; i ++ ) { if ( ! CSVtable -> item ( i , m_NameCol ) || ! ( CSVtable -> item ( i , m_NameCol ) ) -> text ( ) . compare ( " " ) || ! ( CSVtable -> item ( i , m_NameCol ) ) -> text ( ) . compare ( " " ) ) { QTableWidgetItem * item = new QTableWidgetItem ; QString str ( " " ) ; item -> setData ( 0 , str ) ; CSVtable -> setItem ( i , m_NameCol , item ) ; } } } else if ( ( ColumnNameCases -> text ( ) ) . compare ( " " ) == 0 ) { DecolorCol ( 3 ) ; m_NameCol = -1 ; } else { ColumnNameCases -> setText ( " " ) ; } }
Set Name for cases column number
Set Name for cases column number
// decolor the last column //check if it was an other column with this number //Fill it with "no deformation" if there is no data