-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not compile openjp2 #446
Comments
Thank you for bringing this up. It appears that the current iteration of Please check whether the same mitigation strategy in #432 works for you. cargo build --no-default-features --features=default_windows or cargo build --no-default-features --features=default_windows,openjpeg-sys |
@Enet4 Thank you for your reply. [package]
name = "dicom-rs-0-6-3-openjp2-test"
version = "0.1.0"
edition = "2021"
[dependencies]
dicom = { version = "0.6.3", default-features = false, features = ["default_windows", "openjpeg-sys"] } However, when I cargo build it, I get the following error.
|
Would this work? dicom = { version = "0.6.3", default-features = false, features = ["dicom-pixeldata/default_windows", "dicom-pixeldata/openjpeg-sys"] } Otherwise, the subdependencies can be added separately. dicom-pixeldata = { version = "0.2.2", default-features = false, features = ["default_windows", "openjpeg-sys"] } In any case, the plan for DICOM-rs 0.7 is to make JPEG 2000 support opt-in regardless of platform, until there is a reliable cross-platform implementation. |
@9enki I didn't have any problems to compile you dummy repo on my mac (M1). However @Enet4, my project which is very simple, I don't even need Full error log:
Mine current [[bin]]
name = "open-sight"
path = "src/main.rs"
[dependencies]
serde = { version = "1.0.193", features = ["derive"] }
csv = "1.3.0"
dicom = "0.6.3"
rayon = "1.8.0"
walkdir = "2.4.0"
chrono = "0.4.31"
clap = { version = "4.4.11", features = ["derive"] } @Enet4 I tried your suggestions but (I must say I'm very new to # Cargo.toml
dicom = { version = "0.6.3", default-features = false, features = ["dicom-pixeldata/default_windows", "dicom-pixeldata/openjpeg-sys"] }
$ cargo build --target x86_64-pc-windows-gnu --no-default-features --features=default_windows
error: failed to parse manifest at `/mnt/data/awilter/OpenSight/Cargo.toml`
Caused by:
feature `dicom-pixeldata/default_windows` in dependency `dicom` is not allowed to contain slashes
If you want to enable features of a transitive dependency, the direct dependency needs to re-export those features from the `[features]` table. The only piece of my code that uses use dicom::dictionary_std::tags;
use dicom::object::OpenFileOptions;
...
fn extract_dicom_data(path: &Path) -> Result<DicomData, Box<dyn std::error::Error>> {
let obj = OpenFileOptions::new()
.read_until(tags::PIXEL_DATA)
.open_file(path)?;
let patient_id = obj.element_by_name("PatientID")?.to_str()?;
let image_laterality = obj.element_by_name("ImageLaterality")?.to_str()?;
let patient_sex = obj.element_by_name("PatientSex")?.to_str()?;
let patient_dob = obj.element_by_name("PatientBirthDate")?.to_str()?;
let content_date = obj.element_by_name("ContentDate")?.to_str()?;
let modality = obj.element_by_name("Modality")?.to_str()?;
let manufacturer = obj.element_by_name("Manufacturer")?.to_str()?;
let formatted_patient_dob = format_dicom_date(&patient_dob)?;
let formatted_content_date = format_dicom_date(&content_date)?;
let file_path = path
.canonicalize()?
.to_str()
.ok_or("Invalid file path")?
.to_string();
Ok(DicomData {
patient_id: patient_id.to_string(),
image_laterality: image_laterality.to_string(),
patient_sex: patient_sex.to_string(),
patient_dob: formatted_patient_dob,
content_date: formatted_content_date,
modality: modality.to_string(),
manufacturer: manufacturer.to_string(),
file_path,
})
} Anyway, the only way I got Windows to work was: # Cargo.toml
dicom = { version = "0.6.3", default-features = false }
$ cargo build --target x86_64-pc-windows-gnu
Do you have a nightly pre-build of |
@alanwilter In your case you might be better served grabbing the individual library components that you need. dicom_object = "0.6"
dicom_dictionary_std = "0.6" Then in your code: use dicom_dictionary_std::tags;
use dicom_object::OpenFileOptions;
There is no such build yet. All upstream contributions can be seen in this repository. I can follow up on this once I have some spare time and energy. In the meantime, one could contribute with a pull request to exclude |
Thanks @Enet4 that worked nicely. BTW, I'm a python guy and sorry if I'm using the wrong channel (if you know so, please tell me), but how do I do to change |
@alanwilter I have moved your new question to discussions here. |
FYI, I released Update the |
@Neopallium Thank you for the update to |
@Enet4 I hadn't thought about the repo not having an issue tracker. I just created a new repo for There is still a lot of work to refactor all the unsafe Rust in |
Build of
0.6.3
fails on Mac M1.Environment
Mac Book Pro Apple M1
How to reproduce
We have created a repository with the minimum configuration to reproduce the defect. https://github.com/ikneg/dicom-rs-0-6-3-openjp2-test
On wsl2 ubuntu, the
docker compose build
succeeds, but fails with the above Mac configuration.Error log
The text was updated successfully, but these errors were encountered: