add dcm_filehandle_find_frame_number()#117
Conversation
- deprecate dcm_filehandle_get_frame_number() - bump version to 1.3
|
@bgilbert I tinkered a little and thought this was maybe the best way to fix it. This PR adds: bool dcm_filehandle_find_frame_number(DcmError **error,
DcmFilehandle *filehandle,
uint32_t column,
uint32_t row,
uint32_t *frame_number)This new function only returns false on a parse error; if you have a missing tile, it sets With this obvious change to openslide: for (file_num = 0; file_num < l->file_count; file_num++) {
DcmError *dcm_error = NULL;
uint32_t n;
if (!dcm_filehandle_find_frame_number(&dcm_error,
l->files[file_num]->filehandle,
tile_col, tile_row, &n)) {
_openslide_dicom_propagate_error(err, dcm_error);
return false;
}
if (n != 0) {
// found one, record the file that has this tile and break
l->tile_files[tile_index] = file_num;
break;
}
}Before this change, with the 6gb tiled full, no offset DICOM I have: With this PR and openslide change: Blimey! |
|
The speed improvement is so useful I would be tempted to make the next openslide release require libdicom 1.3 with this change. It'd save an ugly What do you think? |
bgilbert
left a comment
There was a problem hiding this comment.
The approach LGTM! Thanks for handling this. I agree with bumping the OpenSlide requirement directly to 1.3.0, since we haven't yet had a release that requires 1.2.0.
and add DCM_DEPRECATED() macro
|
I think I fixed the things you saw, thanks for the careful review. |
bgilbert
left a comment
There was a problem hiding this comment.
LGTM except for two small things.
bgilbert
left a comment
There was a problem hiding this comment.
LGTM, thanks for putting this together so quickly!
See #117 for context