Applications/DTIAtlasFiberAnalyzer/DTIAtlasFiberAnalyzerguiwindow.cxx
/*********************************************************************************
 * When press enter in the QLineEdit in the load frame, load the csv file
 ********************************************************************************/
When press enter in the QLineEdit in the load frame, load the csv file
When press enter in the QLineEdit in the load frame load the csv file
void DTIAtlasFiberAnalyzerguiwindow::EnterCsvFileName()
{
    if( !itksys::SystemTools::FileExists(csvfilename->text().toStdString().c_str() , true ) )
    {
        csvfilename->setText( "" ) ;
        return ;
    }
    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
    if(m_CSV !=NULL)
    {
        clearCSV();
    }
    m_DataCol = -1;
    m_DeformationCol = -1;
    m_NameCol = -1;
    ColumnData->clear();
    ColumnDeformation->clear();
    ColumnNameCases->clear();
    if((csvfilename->text().toStdString())!="")
    {
        std::cout<<std::endl;
        std::cout<<"---- New Data ----"<<std::endl;
        m_csvfilename = csvfilename->text().toStdString();
        if(!m_CSVcreated)
        {
            m_CSV = new CSVClass(m_csvfilename,m_debug);
            m_CSVcreated = true;
        }
        if(m_CSV->loadCSVFile(m_csvfilename))
        {
            FillCSVFileOnQTable();
            addCRframe->setEnabled (true);
            saveframe->setEnabled (true);
            ColumnFrame->setEnabled (true);
        }
    }
    CheckNextStep();
    QApplication::restoreOverrideCursor();
}
void DTIAtlasFiberAnalyzerguiwindow :: EnterCsvFileName ( ) { if ( ! itksys :: SystemTools :: FileExists ( csvfilename -> text ( ) . toStdString ( ) . c_str ( ) , true ) ) { csvfilename -> setText ( " " ) ; return ; } QApplication :: setOverrideCursor ( QCursor ( Qt :: WaitCursor ) ) ; if ( m_CSV != NULL ) { clearCSV ( ) ; } m_DataCol = -1 ; m_DeformationCol = -1 ; m_NameCol = -1 ; ColumnData -> clear ( ) ; ColumnDeformation -> clear ( ) ; ColumnNameCases -> clear ( ) ; if ( ( csvfilename -> text ( ) . toStdString ( ) ) != " " ) { std :: cout << std :: endl ; std :: cout << " " << std :: endl ; m_csvfilename = csvfilename -> text ( ) . toStdString ( ) ; if ( ! m_CSVcreated ) { m_CSV = new CSVClass ( m_csvfilename , m_debug ) ; m_CSVcreated = true ; } if ( m_CSV -> loadCSVFile ( m_csvfilename ) ) { FillCSVFileOnQTable ( ) ; addCRframe -> setEnabled ( true ) ; saveframe -> setEnabled ( true ) ; ColumnFrame -> setEnabled ( true ) ; } } CheckNextStep ( ) ; QApplication :: restoreOverrideCursor ( ) ; }
When press enter in the QLineEdit in the load frame, load the csv file
When press enter in the QLineEdit in the load frame load the csv file
/* Mouse Event when running */ /* Clear the CSV */ //Clear the number of column /* Enable the frame to add column and row */ /* Restore the mouse */