diff --git a/pixeldata/src/gdcm.rs b/pixeldata/src/gdcm.rs index c084d7cf0..e8b5a4536 100644 --- a/pixeldata/src/gdcm.rs +++ b/pixeldata/src/gdcm.rs @@ -498,6 +498,8 @@ mod tests { #[cfg(feature = "ndarray")] #[test] fn test_to_ndarray_signed_word_no_lut() { + use crate::{ConvertOptions, ModalityLutOption}; + let test_file = dicom_test_files::path("pydicom/JPEG2000.dcm").unwrap(); let obj = open_file(test_file).unwrap(); let options = ConvertOptions::new().with_modality_lut(ModalityLutOption::None); diff --git a/pixeldata/src/lib.rs b/pixeldata/src/lib.rs index 84d62b4f1..304ef4775 100644 --- a/pixeldata/src/lib.rs +++ b/pixeldata/src/lib.rs @@ -103,6 +103,7 @@ //! use byteorder::{ByteOrder, NativeEndian}; +#[cfg(not(feature = "gdcm"))] use dicom_core::{DataDictionary, DicomValue}; use dicom_encoding::adapters::DecodeError; #[cfg(not(feature = "gdcm"))] @@ -122,7 +123,9 @@ use num_traits::NumCast; use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; #[cfg(all(feature = "rayon", feature = "image"))] use rayon::slice::ParallelSliceMut; -use snafu::{Backtrace, ResultExt, Snafu, OptionExt}; +use snafu::{Backtrace, ResultExt, Snafu}; +#[cfg(any(not(feature = "gdcm"), feature = "image"))] +use snafu::OptionExt; #[cfg(not(feature = "gdcm"))] use snafu::ensure; #[cfg(not(feature = "gdcm"))]