From 10422140a473682c5098698b45d8d47761c7cfe2 Mon Sep 17 00:00:00 2001 From: Isaiah Norton Date: Sat, 18 Nov 2017 21:52:16 -0500 Subject: [PATCH 1/3] BUG: ITK is row-major; fix NRRD output with mismatched (x,y) axis sizes --- DWIConvert/DWIConverter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DWIConvert/DWIConverter.cxx b/DWIConvert/DWIConverter.cxx index d1b3400f7e..3e12b716cb 100644 --- a/DWIConvert/DWIConverter.cxx +++ b/DWIConvert/DWIConverter.cxx @@ -342,8 +342,8 @@ void DWIConverter::ManualWriteNRRDFile( header << "space: " << this->GetNRRDSpaceDefinition() << "" << std::endl; const DWIConverter::RotationMatrixType& NRRDSpaceDirection = this->GetNRRDSpaceDirection(); - header << "sizes: " << this->GetCols() - << " " << this->GetRows() + header << "sizes: " << this->GetRows() + << " " << this->GetCols() << " " << this->GetSlicesPerVolume() << " " << this->GetNVolume() << std::endl; header << "thicknesses: NaN NaN " << DoubleConvert(GetThickness()) << " NaN" << std::endl; From b6f12e1cac16bc858521df5f95fdff7a0a629ae7 Mon Sep 17 00:00:00 2001 From: Isaiah Norton Date: Sat, 18 Nov 2017 21:52:47 -0500 Subject: [PATCH 2/3] BUG: FSL converter should check reader status --- DWIConvert/FSLDWIConverter.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DWIConvert/FSLDWIConverter.cxx b/DWIConvert/FSLDWIConverter.cxx index 84bcec00c5..dc8ee229fa 100644 --- a/DWIConvert/FSLDWIConverter.cxx +++ b/DWIConvert/FSLDWIConverter.cxx @@ -31,7 +31,8 @@ FSLDWIConverter::LoadFromDisk() Volume4DType::Pointer inputVol; // string to use as template if no bval or bvec filename is given. - ReadScalarVolume(inputVol, fslNIFTIFile, this->m_allowLossyConversion); + if (ReadScalarVolume(inputVol, fslNIFTIFile, this->m_allowLossyConversion) != EXIT_SUCCESS) + throw; // Reorient from FSL standard format to ITK/Dicom standard format this->m_SlicesPerVolume = inputVol->GetLargestPossibleRegion().GetSize()[2]; this->m_NVolume = inputVol->GetLargestPossibleRegion().GetSize()[3]; From 12741b3aa7acb438f6f09303f653344e9140600d Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 29 Nov 2017 14:46:01 -0600 Subject: [PATCH 3/3] ENH: Need to add allowLossy for file types other than short. --- DWIConvert/TestSuite/CMakeLists.txt | 2 +- DWIConvert/TestSuite/FSLMultiShellDataTest.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DWIConvert/TestSuite/CMakeLists.txt b/DWIConvert/TestSuite/CMakeLists.txt index aaac064b51..ceff19d4f4 100644 --- a/DWIConvert/TestSuite/CMakeLists.txt +++ b/DWIConvert/TestSuite/CMakeLists.txt @@ -480,4 +480,4 @@ ExternalData_Add_Test( ${PROJECT_NAME}FetchData NAME DWIConvertMultiShellFSITe ) AddDataDependency(DWIConvertMultiShellFSITestSmallSize) -ExternalData_Add_Target( ${PROJECT_NAME}FetchData ) # Name of data management target \ No newline at end of file +ExternalData_Add_Target( ${PROJECT_NAME}FetchData ) # Name of data management target diff --git a/DWIConvert/TestSuite/FSLMultiShellDataTest.cmake b/DWIConvert/TestSuite/FSLMultiShellDataTest.cmake index 9870c424ac..5b5b19fc74 100644 --- a/DWIConvert/TestSuite/FSLMultiShellDataTest.cmake +++ b/DWIConvert/TestSuite/FSLMultiShellDataTest.cmake @@ -2,6 +2,7 @@ # first, convert multishell FSL into Nrrd set(command_line ${TEST_PROGRAM} + --allowLossyConversion --inputVolume ${INPUTVOLUME} --outputVolume ${OUTPUTVOLUME} ) @@ -51,4 +52,4 @@ if(TEST_RESULT) "Failed: Recovering bvec or bval files do not match the original FSL file") endif() -message("Passed") \ No newline at end of file +message("Passed")