[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63338] [octave forge] (dicom) dicomwrite give
From: |
John Donoghue |
Subject: |
[Octave-bug-tracker] [bug #63338] [octave forge] (dicom) dicomwrite gives wrong result when image size is not square |
Date: |
Wed, 9 Nov 2022 08:39:04 -0500 (EST) |
Update of bug #63338 (project octave):
Item Group: None => Incorrect Result
Status: None => Confirmed
Operating System: Microsoft Windows => Any
_______________________________________________________
Follow-up Comment #3:
actually looking at data returned i think is just that it saved the row/column
values rather than the data incorrectly
octave:32> X = int16(10*rand (2,5))
X =
6 2 1 4 0
8 3 4 5 6
octave:33> dicomwrite(X, 't.dcm')
octave:34> Z = dicomread('t.dcm')
Z =
6 2
1 4
0 8
3 4
5 6
So changing dicomwrite.cc
diff -r 08d5db97fc5c src/dicomwrite.cpp
--- a/src/dicomwrite.cpp Thu Oct 13 16:59:41 2022 -0400
+++ b/src/dicomwrite.cpp Wed Nov 09 08:35:22 2022 -0500
@@ -461,8 +461,8 @@
gdcm::SmartPointer<gdcm::Image> im = new gdcm::Image;
im->SetNumberOfDimensions (2);
- im->SetDimension (0, pixval->dims()(0));
- im->SetDimension (1, pixval->dims()(1));
+ im->SetDimension (1, pixval->dims()(0));
+ im->SetDimension (0, pixval->dims()(1));
gdcm::Attribute<0x0028,0x0004> pi_at;
if (ds.FindDataElement (pi_at.GetTag()))
And re-running
octave:2> X = int16(10*rand (2,5))
X =
9 1 6 5 1
5 2 9 8 3
octave:3> dicomwrite(X, 't.dcm')
octave:4> Z = dicomread('t.dcm')
Z =
9 1 6 5 1
5 2 9 8 3
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63338>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/