View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003954 | Slicer4 | Module DICOM | public | 2015-02-06 08:59 | 2018-10-03 04:52 |
Reporter | xiaw | Assigned To | pieper | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | Slicer 4.4.0 | ||||
Target Version | Fixed in Version | Slicer 4.5.0-1 | |||
Summary | 0003954: Dicom scene export is working inconsistently | ||||
Description | Dicom scene export function isn't working consistently. Sometimes it can export scene successfully but most times it doesn't work. This functionality has been disabled for a while. I think I have a solution to this problem and I will submit the change soon. | ||||
Tags | No tags attached. | ||||
Did you have any luck working on this? |
|
I think I have the solution but the hospital network prevents me from uploading the code to the repository and I have been busy with other works. Can I send the modified code to you via email for you to verify? |
|
Sure, that would be fine. |
|
Mailed to pieper@isomics.com. Thanks! |
|
r24266 http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=24266 Thanks for the fixes! I needed to do some other tweaks to get things working, but it seems reliable to |
|
Awesome. I am glad it worked out! Also, I can't take the credit alone. Kevin helped me greatly during this fix. |
|
Nice work and thanks to both you and Kevin for fixing it. I'd never figured out why it just wasn't working but it's a fun feature and I hope people find it useful. |
|
Great! Thanks! |
|
I am having problems with exporting a scene to DICOM (windows and mac, 4.8.1 and 4.9.0, always with the same error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xdc in position"), but it's working on linux. Any hintes? Thanks |
|
@skat it looks like there's an unexpected character, perhaps something like a non-ascii character in a username or directory path? It would be great if you could provide a way to reproduce the issue using publicly available data (e.g. from the SampleData module or similar). |
|
Hi, I changed the code a little bit |
|
Hi, sorry for the delay. I tried again, with test data and my own, and now it works (without my changes). Strange, I only rebooted the system in the meantime. Only thing that still happens is that the scene is added to the last patient in the DICOM list, so if there are more than one patient, it is a bit abritrary where the bundle file ends up with. |
|
Back to "normal", i.e. not working. With only the MR-head from the testdata loaded, I cannot create the DICOM/scene file. Attached are all logs I get. |
|
I can only re-iterate Steve: |
|
Well I tried to copy all the info from the logs into the text file. What I did was:
I'm not experienced with python, if you could tell me how to print the contents of candygram I am happy to provide the information. I am using my modification again: dump = str(dump) + candygram.encode('utf8'), then it works more or less. |
|
Thanks for the description! I also get an error, but it's a different one. Basically for me the first problem seems to be this: Steve, do you have time to investigate this? You know the exporter the best. Thanks! |
|
Thanks for reporting this - I took a look and the underlying problem appears to be the way the mrb data is being encoded in the dicom file. Currently we use dump2dcm to make the dicom binary from a text file and put the mrb in a private tag (this should be good) but the's value representation (VR) is LO (long string) which is a limitation because the mrb could have arbitrary characters in it. https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMLib/DICOMExportScene.py#L154-L175 Instead it looks like we should be able to use option 3 of the NOTES: Dump File Description section of the dump2dcm manual where OB (other byte) data is encoded in an external file using a syntax like "=mrbData.dat". This would avoid the whole encoding step. https://support.dcmtk.org/docs/dump2dcm.html I don't really have time to fix this right now but I'd be happy to work with someone who wanted to implement the changes and test them (probably best to write a self-test to confirm it's working as expected). I'm not sure about the part involving which patient it is associated with, is that something you know about @pinter? Is that something managed by the subject hierarchy and the export dialog? |
|
Thanks for verifying this. As I noted before it seems to work on linux (at least when I tested it once), but a clean solution would of course be preferable. |
|
I should really write a selftest for this. @pinter are there any dicom export tests currently, maybe as part of the subject hierarchy? |
|
Yes exactly, this test has DICOM import and loading: |
|
Hi everyone, I finished some other project and can offer to help/test things now if needed. |
|
Import 2017-06-07 23:51:09: master d7ec00d8 2015-05-19 17:55:01 Details Diff |
BUG: 0003954 fixes slicer bundle scene import/export * zip file size could not be correctly passed, so now there is an alternate encoding (hack) that works well. * missing storage nodes prevented correct export * export widget embedded python code had a missing import of DICOMLib Special Thanks to Xia, Wenyao <wenyao.xia@rmp.uhn.ca> for his bug fixes! git-svn-id: http://svn.slicer.org/Slicer4/trunk@24266 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Modules/Scripted/DICOMLib/DICOMExportScene.py | Diff File | ||
mod - Modules/Scripted/DICOMLib/Widgets/qSlicerDICOMExportDialog.cxx | Diff File | ||
mod - Modules/Scripted/DICOMPlugins/DICOMSlicerDataBundlePlugin.py | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-02-06 08:59 | xiaw | New Issue | |
2015-02-06 08:59 | xiaw | Status | new => assigned |
2015-02-06 08:59 | xiaw | Assigned To | => pieper |
2015-02-06 10:47 | xiaw | Description Updated | |
2015-05-14 15:55 | pieper | Note Added: 0013060 | |
2015-05-14 15:55 | pieper | Status | assigned => feedback |
2015-05-15 11:43 | xiaw | Note Added: 0013069 | |
2015-05-15 11:44 | pieper | Note Added: 0013070 | |
2015-05-15 12:09 | xiaw | Note Added: 0013071 | |
2015-05-19 14:23 | pieper | Note Added: 0013076 | |
2015-05-19 14:23 | pieper | Status | feedback => resolved |
2015-05-19 14:23 | pieper | Resolution | open => fixed |
2015-05-21 11:16 | xiaw | Note Added: 0013092 | |
2015-05-21 11:19 | pieper | Note Added: 0013093 | |
2015-05-21 11:19 | pieper | Status | resolved => closed |
2015-05-21 11:19 | pieper | Fixed in Version | => Slicer 4.4.1 |
2015-05-27 06:42 | pinter | Note Added: 0013105 | |
2015-09-09 08:29 | jcfr | Fixed in Version | Slicer 4.4.1 => Slicer 4.5.0-1 |
2017-06-10 08:51 | pieper | Changeset attached | => Slicer master d7ec00d8 |
2018-07-19 05:51 | skat | File Added: slicer_error.txt | |
2018-07-19 05:51 | skat | Note Added: 0015922 | |
2018-07-19 09:26 | pieper | Note Added: 0015923 | |
2018-07-19 11:10 | skat | Note Added: 0015924 | |
2018-07-25 04:01 | skat | Note Added: 0015927 | |
2018-07-25 07:07 | skat | File Added: slicer_dicom_export.txt | |
2018-07-25 07:07 | skat | Note Added: 0015928 | |
2018-07-25 10:10 | pinter | Note Added: 0015929 | |
2018-07-25 10:56 | skat | Note Added: 0015930 | |
2018-07-25 12:22 | pinter | Note Added: 0015931 | |
2018-07-25 17:47 | pieper | Note Added: 0015933 | |
2018-07-26 03:09 | skat | Note Added: 0015934 | |
2018-07-26 07:57 | pieper | Note Added: 0015935 | |
2018-07-26 10:47 | pinter | Note Added: 0015936 | |
2018-10-03 04:52 | skat | Note Added: 0016063 |