Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
aa271ecf
Commit
aa271ecf
authored
May 03, 2007
by
Sebastien Barre
Browse files
ENH: the pixel spacing was wrong. And ambiguous
parent
20baf892
Changes
2
Hide whitespace changes
Inline
Side-by-side
IO/vtkDICOMImageReader.h
View file @
aa271ecf
...
...
@@ -81,7 +81,10 @@ class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2
vtkGetStringMacro
(
DirectoryName
);
// Description:
// Returns the pixel spacing.
// Returns the pixel spacing (in X, Y, Z).
// Note: if there is only one slice, the Z spacing is set to the slice
// thickness. If there is more than one slice, it is set to the distance
// between the first two slices.
double
*
GetPixelSpacing
();
// Description:
...
...
Utilities/DICOMParser/DICOMAppHelper.cxx
View file @
aa271ecf
...
...
@@ -778,15 +778,20 @@ void DICOMAppHelper::PixelSpacingCallback(DICOMParser *parser,
unsigned
char
*
val
,
quadbyte
)
{
float
fval
=
DICOMFile
::
ReturnAsFloat
(
val
,
parser
->
GetDICOMFile
()
->
GetPlatformIsBigEndian
());
if
(
group
==
0x0028
&&
element
==
0x0030
)
{
this
->
PixelSpacing
[
0
]
=
this
->
PixelSpacing
[
1
]
=
fval
;
if
(
!
val
||
sscanf
((
char
*
)(
val
),
"%f
\\
%f"
,
&
this
->
PixelSpacing
[
0
],
&
this
->
PixelSpacing
[
1
])
!=
2
)
{
this
->
PixelSpacing
[
0
]
=
this
->
PixelSpacing
[
1
]
=
0.0
;
}
}
else
if
(
group
==
0x0018
&&
element
==
0x0050
)
{
this
->
PixelSpacing
[
2
]
=
fval
;
this
->
PixelSpacing
[
2
]
=
DICOMFile
::
ReturnAsFloat
(
val
,
parser
->
GetDICOMFile
()
->
GetPlatformIsBigEndian
());
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment