Skip to content
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

Write Media issue on DICOM Media Sample #59

Open
CountJung opened this issue Jan 18, 2021 · 1 comment
Open

Write Media issue on DICOM Media Sample #59

CountJung opened this issue Jan 18, 2021 · 1 comment

Comments

@CountJung
Copy link

When I trying to make DICOMDIR in DICOM Media example, just tried command like this
(patient1, 2 is included in example)
cmd line> dicom.media.exe write data\patient1
and then program get exception
Content "DicomFile" does not validate VR CS: value exceeds maximum length of 16 characters - with sample DICOM file
or trying my own file also get exception
Content "DicomFile" does not validate VR CS: value contains invalid character. Only uppercase character, digits, space and underscore alre allowed

I REALLY wants to avoid above 2 exception it is just validate option. So I tried code like this at WriteMedia Method
var dicomFile = Dicom.DicomFile.Open(file.FullName);
//dicomFile.Dataset.AutoValidate = false; --> Not Using
dicomFile.Dataset.NotValidated(); --> Not Working
dicomDir.AddFile(dicomFile, string.Format(@"000001{0}", file.Name)); --> Throws Exception above 2

Am I missing something? VR: Code String is too obscure to figure out.

@gofal
Copy link
Contributor

gofal commented May 19, 2021

No, you did not miss anything. The validation exceptions should throw when you create new data, but should not throw when processing existing data.
I am affraid I have not updated the samples for some time. Please try the code with latest release of fo-dicom from nuget, there have been quite some fixes in validation code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants