diff --git a/DWIConvert/DWIConverter.cxx b/DWIConvert/DWIConverter.cxx index e7e5a425f..d1b3400f7 100644 --- a/DWIConvert/DWIConverter.cxx +++ b/DWIConvert/DWIConverter.cxx @@ -175,8 +175,11 @@ void DWIConverter::ReadGradientInformation(const std::string& inputBValues, cons if( CheckArg("B Values", inputBValues, "") == EXIT_FAILURE ) { std::vector pathElements; - pathElements.push_back(baseDirectory); - pathElements.push_back("/"); + if (!baseDirectory.empty()) + { + pathElements.push_back(baseDirectory); + pathElements.push_back("/"); + } pathElements.push_back( itksys::SystemTools::GetFilenameWithoutExtension (inputVolumeNameTemplate) + ".bval"); _inputBValues = itksys::SystemTools::JoinPath(pathElements); std::cout << " From template " << inputVolumeNameTemplate << std::endl; @@ -186,8 +189,11 @@ void DWIConverter::ReadGradientInformation(const std::string& inputBValues, cons if( CheckArg("B Vectors", inputBVectors, "") == EXIT_FAILURE ) { std::vector pathElements; - pathElements.push_back(baseDirectory); - pathElements.push_back("/"); + if (!baseDirectory.empty()) + { + pathElements.push_back(baseDirectory); + pathElements.push_back("/"); + } pathElements.push_back( itksys::SystemTools::GetFilenameWithoutExtension(inputVolumeNameTemplate) + ".bvec" ); _inputBVectors = itksys::SystemTools::JoinPath(pathElements); std::cout << " From template " << inputVolumeNameTemplate << std::endl; @@ -286,7 +292,7 @@ std::string DWIConverter::MakeFileComment( << "# part of the BRAINSTools package." << std::endl << "# Command line options:" << std::endl << "# --inputFileType " << inputFileType << std::endl; - if( std::abs( smallGradientThreshold- 0.2 ) > 1e-4 ) + if( std::abs( smallGradientThreshold - 0.2 ) > 1e-4 ) { commentSection << "# --smallGradientThreshold " << smallGradientThreshold << std::endl; } @@ -695,4 +701,4 @@ double DWIConverter::readThicknessFromDict(){ myValidator.SetMetaDataDictionary(m_Volume->GetMetaDataDictionary()); m_thickness = myValidator.GetThicknesses().at(2); return m_thickness; -} \ No newline at end of file +} diff --git a/DWIConvert/DWIConverterFactory.cxx b/DWIConvert/DWIConverterFactory.cxx index f8cca8582..0febc6b7f 100644 --- a/DWIConvert/DWIConverterFactory.cxx +++ b/DWIConvert/DWIConverterFactory.cxx @@ -177,7 +177,8 @@ DWIConverter* DWIConverterFactory::New() { converter = new SiemensDWIConverter(m_Headers,m_InputFileNames, m_UseBMatrixGradientDirections, - m_SmallGradientThreshold, m_FSLFileFormatHorizontalBy3Rows); + m_FSLFileFormatHorizontalBy3Rows, + m_SmallGradientThreshold); } else if(StringContains(this->m_Vendor,"GE")) { @@ -199,4 +200,4 @@ DWIConverter* DWIConverterFactory::New() } return converter; } -std::string DWIConverterFactory::GetVendor() { return m_Vendor; } \ No newline at end of file +std::string DWIConverterFactory::GetVendor() { return m_Vendor; } diff --git a/DWIConvert/SiemensDWIConverter.cxx b/DWIConvert/SiemensDWIConverter.cxx index f45dc3119..7c54d2c61 100644 --- a/DWIConvert/SiemensDWIConverter.cxx +++ b/DWIConvert/SiemensDWIConverter.cxx @@ -4,17 +4,18 @@ #include "SiemensDWIConverter.h" SiemensDWIConverter::SiemensDWIConverter (DWIDICOMConverterBase::DCMTKFileVector &allHeaders, -DWIConverter::FileNamesContainer &inputFileNames, -const bool useBMatrixGradientDirections, -const bool FSLFileFormatHorizontalBy3Rows, -const double smallGradientThreshold) : DWIDICOMConverterBase(allHeaders,inputFileNames, - useBMatrixGradientDirections, - FSLFileFormatHorizontalBy3Rows), -m_SmallGradientThreshold(smallGradientThreshold), -m_MMosaic(0), -m_NMosaic(0), -m_Stride(0), -m_HasCSAHeader(false) + DWIConverter::FileNamesContainer &inputFileNames, + const bool useBMatrixGradientDirections, + const bool FSLFileFormatHorizontalBy3Rows, + const double smallGradientThreshold) : + DWIDICOMConverterBase(allHeaders,inputFileNames, + useBMatrixGradientDirections, + FSLFileFormatHorizontalBy3Rows), + m_SmallGradientThreshold(smallGradientThreshold), + m_MMosaic(0), + m_NMosaic(0), + m_Stride(0), + m_HasCSAHeader(false) { }