Commit a9765b63 by Gregory C. Sharp

Fix reversed row/column for dcmtk import/export

parent ec063193
......@@ -246,10 +246,12 @@ Dcmtk_file::load_header (const char *fn) {
/* PixelSpacing */
ofrc = dset->findAndGetString (DCM_PixelSpacing, c);
if (ofrc.good() && c) {
float spacing[3];
int rc = parse_dicom_float2 (spacing, c);
float dcm_spacing[2];
int rc = parse_dicom_float2 (dcm_spacing, c);
if (!rc) {
spacing[2] = 0.0;
float spacing[3] = {
dcm_spacing[1], dcm_spacing[0], 0.0
};
d_ptr->m_vh.set_spacing (spacing);
}
}
......
......@@ -501,7 +501,7 @@ dcmtk_save_slice (const Rt_study_metadata::Pointer rsm, Dcmtk_slice_data *dsd)
}
/* Image Plane module */
tmp = string_format ("%f\\%f", dsd->vol->spacing[0], dsd->vol->spacing[1]);
tmp = string_format ("%f\\%f", dsd->vol->spacing[1], dsd->vol->spacing[0]);
dataset->putAndInsertString (DCM_PixelSpacing, tmp.c_str());
dataset->putAndInsertString (DCM_ImageOrientationPatient, dsd->iop.c_str());
dataset->putAndInsertString (DCM_ImagePositionPatient, dsd->ipp.c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment