View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003163 | Slicer4 | Module DICOM | public | 2013-06-12 06:29 | 2018-03-02 11:06 |
Reporter | inorton | Assigned To | nicole | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.5.0-1 | Fixed in Version | Slicer 4.5.0-1 | ||
Summary | 0003163: Export from DICOM browser | ||||
Description | It would be very helpful to have export-to-directory capability in the DICOM browser. I need to select a series and have "export" copy the original underlying files to a specific directory, preferably with a configurable naming/numbering convention. I read that integration with the "Create DICOM Series" CLI module is planned (also helpful), however this copy-export feature is distinct and hopefully simpler. | ||||
Tags | No tags attached. | ||||
Yes, being able to export to named files is a great idea. Regarding the "Create a DICOM Series" module, that is included already, but can no doubt be improved. You need to select a study in the tree, then right click to get the context menu and then pick Export to Study and pick the to export. See the screenshot here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.2/Modules/DICOM |
|
Oh, that's great - the export button was grayed out, and I had not tried the context menu. One issue with the context menu is that it re-runs the "Checking ..." business every time the study name is clicked, which can take time for a large study and leads to weird UI behavior (ie the context menu appears somewhere else if the mouse is moved). |
|
At the last CTK meeting we worked on a new set of widgets to replace the tree view and that should improve the overall behavior: http://www.commontk.org/index.php/CTK-Hackfest-May-2013#Gallery_of_Results Regarding the export, it only lets you access the fields from the Create a DICOM Series module - hopefully that's enough for real world use, but if you see issues with that let me know. |
|
context->'Export to study' does not work in current trunk. |
|
Yes, that got lost along with the Delete option in when switching from the tree view to the browser tables. Alireza and I went over the code this afternoon so maybe he can re-enable the export at the same time as the delete operation. On a related note, I was able to open source a small script I developed a while back that implements a kind of pretty-print named file organization for dicom files [1]. It might be useful on it's own, but the code could also be used to create the export directories from the database. https://github.com/pieper/dicomsort This should be easy to do now that pydicom is included in the default slicer build: https://github.com/jcfr/Slicer/commit/593642d0b7265b02354c1d7cdcf0993cffdc2914 |
|
I'm working on a comprehensive DICOM export mechanism in Slicer, see Please comment on the plans if you have additional needs. |
|
Implemented, see |
|
Feature added in commit |
|
@inorton: Any luck trying it? |
|
I'm working on another right cilck context menu item for the CTK DICOM browser and was asked to add this feature in as well, see discussion here: |
|
I've used the Qt toLatin1() string converter for creating driectory strings from the DICOM metadata, is that safe enough? https://github.com/naucoin/CTK/tree/3163-export-series-to-file-system |
|
@nicole I'm not completely sure, but I think at the moment toLatin1 is safe, as this function is used at many places in the code for casts and conversions. |
|
Andrey was worried about the undefined behaviour for certain strings, so since it's a low precision directory structure conversion, I did a straight up character replacement for anything non alpha numeric. |
|
That sounds a bit over-cautious to me. Maybe we can have a default mode where it tries to write all characters except the ones that I flagged in my code dicomsort linked above, but then a more compatible option that replaces all alphanumeric characters. I think it can be confusing to people when dashes, periods, commas, and other common characters are converted to an escape sequence. |
|
@pieper: Your code[1] replaces period and commas: Options:
The replacement strategy needs to leave the directory separators and the dashes and periods used to build up the directory paths and file names. I'd prefer to have a single strategy to keep it simple, users can rename the directories if they wish. [1] link for ease of finding it again: |
|
Currently using this naming convention: |
|
Sorry guys I've been missing on all the action by not monitoring this issue!
Based on the considerations above, I suggest the naming (note I added extra directory level to separate files in series): %PatientID-%PatientName/%StudyDate-%StudyDesciption/%SeriesNumber-%SeriesDescription/%SOPInstanceUID.dcm or %PatientID-%PatientName/%StudyDate-%StudyDesciption/%SeriesNumber-%SeriesDescription/<sequential file number within the series formatted to %06d>.dcm @pieper, @pinter: what do you think? Let's try to close this topic. If you have strong opinions about any of the above, please suggest an alternative. We need to move on to other things. |
|
Seems fine to me ! |
|
@fedorov: for the sequential file number, did you mean to use the file name from the original database file? |
|
No, when I said "sequential file number", I meant if we have 10 files in the series, we will name them 000000.dcm, 000001.dcm, ..., 000010.dcm. |
|
correction ... the last one should have been 000009.dcm ;) |
|
I was worried that I wasn't going to get the files in the scan order, but they do contain that information in the dicom headers so it should be reconstructable, correct? |
|
I would not worry about this. The user should not rely on ordering of slices by file name for volume reconstruction. |
|
Okay. I'm currently generating paths that look like this: |
|
This is fine by me. |
|
Directory and file name changes pushed to my CTK topic branch: Any other feedback before I squash, rebase and do a pull request? |
|
Can I stop by to see a demo? I don't have time to make a custom build of Slicer to test this. |
|
Sure, before 12:30 or after 1:30 would work. |
|
Feedback based on the demo: 1) use sequential numbers for file names, to avoid over-write |
|
Done, squashed and rebased: |
|
Pull request: |
|
Had some discussions with Steve and JC about recovering gracefully from failures, having options for the export directory structure, but those will get pushed to the next version of the export. Pull request integrated in CTK: |
|
Slicer pull request intgrated: |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2013-06-12 06:29 | inorton | New Issue | |
2013-06-12 06:29 | inorton | Status | new => assigned |
2013-06-12 06:29 | inorton | Assigned To | => pieper |
2013-06-12 06:40 | pieper | Note Added: 0008756 | |
2013-06-12 08:23 | inorton | Note Added: 0008757 | |
2013-06-12 08:29 | pieper | Note Added: 0008758 | |
2014-02-12 10:52 | inorton | Note Added: 0010584 | |
2014-02-12 12:08 | pieper | Note Added: 0010585 | |
2014-04-16 05:16 | pieper | Assigned To | pieper => mehrtash |
2014-09-22 07:30 | pinter | Note Added: 0012581 | |
2014-11-13 12:59 | pinter | Note Added: 0012694 | |
2014-12-01 14:29 | pinter | Assigned To | mehrtash => pinter |
2014-12-01 14:29 | pinter | Note Added: 0012741 | |
2014-12-01 14:29 | pinter | Status | assigned => resolved |
2014-12-01 14:29 | pinter | Fixed in Version | => Slicer 4.4.1 |
2014-12-01 14:29 | pinter | Resolution | open => fixed |
2014-12-01 14:36 | pinter | Note Edited: 0012741 | |
2014-12-01 19:24 | jcfr | Relationship added | related to 0003910 |
2015-01-08 10:53 | pinter | Note Added: 0012862 | |
2015-09-01 10:30 | nicole | Note Added: 0013250 | |
2015-09-01 10:30 | nicole | Assigned To | pinter => nicole |
2015-09-01 10:30 | nicole | Target Version | => Slicer 4.5.0-1 |
2015-09-01 10:31 | nicole | Status | resolved => acknowledged |
2015-09-09 08:28 | jcfr | Fixed in Version | Slicer 4.4.1 => Slicer 4.5.0-1 |
2015-10-06 15:31 | nicole | Note Added: 0013349 | |
2015-10-06 15:44 | nicole | Note Edited: 0013349 | |
2015-10-08 08:07 | pinter | Note Added: 0013363 | |
2015-10-08 08:36 | nicole | Note Added: 0013364 | |
2015-10-08 08:43 | pieper | Note Added: 0013365 | |
2015-10-08 08:43 | nicole | Note Edited: 0013364 | |
2015-10-08 11:04 | nicole | Note Added: 0013366 | |
2015-10-08 11:31 | nicole | Note Added: 0013367 | |
2015-10-08 11:55 | fedorov | Note Added: 0013368 | |
2015-10-08 15:28 | pieper | Note Added: 0013369 | |
2015-10-09 07:37 | nicole | Note Added: 0013373 | |
2015-10-09 07:39 | fedorov | Note Added: 0013374 | |
2015-10-09 07:40 | fedorov | Note Added: 0013375 | |
2015-10-09 07:51 | nicole | Note Added: 0013376 | |
2015-10-09 08:02 | fedorov | Note Added: 0013377 | |
2015-10-09 08:11 | nicole | Note Added: 0013378 | |
2015-10-09 08:13 | fedorov | Note Added: 0013379 | |
2015-10-09 08:37 | nicole | Note Added: 0013380 | |
2015-10-09 08:41 | fedorov | Note Added: 0013381 | |
2015-10-09 08:48 | nicole | Note Added: 0013382 | |
2015-10-09 09:31 | fedorov | Note Added: 0013383 | |
2015-10-09 13:17 | nicole | Note Added: 0013384 | |
2015-10-09 13:34 | nicole | Note Added: 0013385 | |
2015-10-21 11:47 | nicole | Note Added: 0013390 | |
2015-10-22 12:30 | nicole | Note Added: 0013391 | |
2015-10-22 12:30 | nicole | Status | acknowledged => resolved |
2018-03-02 11:06 | jcfr | Status | resolved => closed |