Applications/DTIAtlasFiberAnalyzer/DTIAtlasFiberAnalyzerguiwindow.cxx
/************************************************************************************
 * ReadDataFilesNameInCaseDirectory : Fill the datafiles vector with every file name
 * 	in the Case directory for relevant fibers.
 ************************************************************************************/
ReadDataFilesNameInCaseDirectory : Fill the datafiles vector with every file name
in the Case directory for relevant fibers.
ReadDataFilesNameInCaseDirectory : Fill the datafiles vector with every file name in the Case directory for relevant fibers .
void DTIAtlasFiberAnalyzerguiwindow::ReadDataFilesNameInDirectory(vstring &datafiles, std::string Dir)
{
    std::string nameofcase=Dir.substr(Dir.find_last_of("/")+1, Dir.size()-Dir.find_last_of("/")+1);
    itksys::Directory directory;
    directory.Load(Dir.c_str());
    unsigned long NumberOfFiles = directory.GetNumberOfFilesInDirectory(Dir.c_str());
    std::string filename, extensionoffile, fiber, filefiber;
    for(int j=0; j<FiberSelectedList->count(); j++)
    {
        fiber=takeoffExtension(((FiberSelectedList->item(j))->text()).toStdString());
        for( unsigned long i=0;i<NumberOfFiles;i++)
        {
            filename=directory.GetFile(i);
            filefiber=takeoffExtension(filename);
            if(filefiber.size()!=0)
            {
                filefiber=filefiber.substr(nameofcase.size()+1, filefiber.size()-nameofcase.size()+1);
                extensionoffile = ExtensionofFile(filename);
                if(extensionoffile.compare("fvp")==0 && filefiber.rfind(fiber)!=std::string::npos)
                {
                    datafiles.push_back(filename);
                }
            }
        }
    }
}
void DTIAtlasFiberAnalyzerguiwindow :: ReadDataFilesNameInDirectory ( vstring & datafiles , std :: string Dir ) { std :: string nameofcase = Dir . substr ( Dir . find_last_of ( " " ) + 1 , Dir . size ( ) - Dir . find_last_of ( " " ) + 1 ) ; itksys :: Directory directory ; directory . Load ( Dir . c_str ( ) ) ; unsigned long NumberOfFiles = directory . GetNumberOfFilesInDirectory ( Dir . c_str ( ) ) ; std :: string filename , extensionoffile , fiber , filefiber ; for ( int j = 0 ; j < FiberSelectedList -> count ( ) ; j ++ ) { fiber = takeoffExtension ( ( ( FiberSelectedList -> item ( j ) ) -> text ( ) ) . toStdString ( ) ) ; for ( unsigned long i = 0 ; i < NumberOfFiles ; i ++ ) { filename = directory . GetFile ( i ) ; filefiber = takeoffExtension ( filename ) ; if ( filefiber . size ( ) != 0 ) { filefiber = filefiber . substr ( nameofcase . size ( ) + 1 , filefiber . size ( ) - nameofcase . size ( ) + 1 ) ; extensionoffile = ExtensionofFile ( filename ) ; if ( extensionoffile . compare ( " " ) == 0 && filefiber . rfind ( fiber ) != std :: string :: npos ) { datafiles . push_back ( filename ) ; } } } } }
ReadDataFilesNameInCaseDirectory : Fill the datafiles vector with every file name
      in the Case directory for relevant fibers.
ReadDataFilesNameInCaseDirectory : Fill the datafiles vector with every file name in the Case directory for relevant fibers .
//save the name of the Data Files in an vstring