View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003081 | Slicer4 | Core: GUI | public | 2013-04-20 02:39 | 2017-06-07 23:27 |
Reporter | kikinis | Assigned To | finetjul | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Product Version | |||||
Target Version | Slicer 4.3.0 | Fixed in Version | Slicer 4.3.0 | ||
Summary | 0003081: when dragging and dropping a dicom file or folder into slicer, the dicom widget should be invoked by default | ||||
Description | This will increase the consistency of the user experience in Slicer | ||||
Tags | No tags attached. | ||||
r21904: Add mechanism to register dialogs for drag&drop |
|
I took a look at this - it is technically doable to make to integrate dicom with drag and drop, but we have a policy question to sort out for dropping folders and dicom files onto the application. Current behavior: if a folder is dropped on slicer, all individual files are added to the Add Data dialog. Suggested behavior: all dropped folders should be sent to the dicom module and only dropped files should be handled by the Add Data dialog. I would think of implementing this suggested behavior by adding something like a directoryDropped(QStringList) signal from the slicer main window. Other alternatives could be: (1) we could figure out a way for modules to register their interest in dropped directories and they would have a chance to inspect their contents before grabbing them (i.e. according to a priority scheme). This could be tricking since each module might have to do a recursive search and also it might find some files it understands and some it isn't able to load. At least for DICOM, this would be almost as much work (and redundant with) the actual import process. (2) when the user drops a folder we could pop up a dialog asking if they want to load this as DICOM or as non-DICOM data. This strikes me as a little messy, but maybe it's not so bad. |
|
Steve, my commit (r21904) kind of do what you suggest. So it should work if the dicom module registers an IO dialog that only accepts DICOM directories in the dropEvent() method. No ? |
|
I more-or-less agree with you Julien, but the problem is that without inspecting the contents of folders (and subfolders) it's not clear which IO dialog should handle a folder (DICOM folders can have arbitrary layout and filenames, with no required file extension). So I would see it as more clear at a documentation/user level to say that all folders get sent to the DICOM module but all multiple file drops go to the IO dialogs. Or, as in my option (2) we could prompt the user to ask which action they have in mind. |
|
I like the "ask the user" option. Let them decide instead of us guessing. |
|
I'm confused :-), what's the problem with analyzing the contents of the mime data url path. Why the registered DICOM dialog wouldn't be able to do that ? Option (2) is also fine and should be easy to implement in qSlicerIOManager::dropEvent() which would get the list of all the readers that handle the mime data content, and popup a menu with such list (let me know if you want to go that way). Btw, I think the dropevent should stay flexible enough to support more than just filepaths. Mime can contain images or custom content which would make Slicer support drag&drop from other applications(for example, you could drag&drop openIgt configuration to setup a connection... |
|
The key point is that a "DICOM url" in this context means exactly "any directory" due to the ambiguity of knowing what is in the directory without looking. Getting back to the big picture, if Ron likes the idea of prompting the user with a dialog, let's do that. For that, a clean way to do this would be for the qSlicerAppMainWindow to issue the put up a dialog inside the dropEvent method so that if one or more directories are dropped, it asks if the data should be interpreted as DICOM or non-DICOM data. Then if the user picks DICOM, the qSlicerAppMainWindow can emit a signal like dicomImportRequest(QStringList) and the DICOM module can take it from there. It's a shame we have to go through convoluted special cases like this, but DICOM data really is not like traditional file formats like .vtk or .nrrd. |
|
Ok for the dialog. However, I disagree with you concerning the clean way. |
|
I don't really care if it's the qSlicerIOManger or the qSlicerAppMainWindow that fires the signals. To me, adding another subclass just to do this seems like overkill. If one of the existing classes emits the signal then everything can be handled with just a few lines of code. Connecting to signals seems much nicer than registering a dialog. On the other hand, I'm trying to think of what a qSlicerScriptedFileDialog would do. In my view a pure python extension to be able to configure and extend all parts of slicer, so if this adds more scriptable functionality I'm all for it. |
|
Scriptable file dialog added in r21951: |
|
Impressive work Julien - but it's not building for me on mac. In file included from /Users/pieper/slicer4/latest/Slicer/Base/QTGUI/qSlicerFileDialog.cxx:31: |
|
Seems the line is duplicated - if I remove one it seems to work fine. Do you have a preference for removing the one before the class declaration or the one after? $ grep META /Users/pieper/slicer4/latest/Slicer/Base/QTGUI/qSlicerFileDialog.h |
|
Sorry about that. I've a slight preference for removing the second one. (I should have moved qSlicerStandardFileDialog into a separate file :-/ ) |
|
No problem ;) Fixed in r21953 I'll try to have a look at integrating this with the dicom module this afternoon and let you know if I have questions. |
|
To slightly improve the user experience: If I drag a dicom directory into slicer, the popup defaults to "Any Data". That is potentially confusing. It should default to "Dicom", with any data as a pull down option |
|
@Julien - Is there an easy place to implement Ron's request? |
|
Load DICOM by default is fixed in r22267 |
|
Slicer: 2145-support-for-installing-extension-from-file cbcecd95 2013-04-20 18:06:25 Details Diff |
ENH: Add drag&drop support for registered IO dialogs. To support drag&drop, a qSlicerFileDialog derived class should reimplement: * qSlicerFileDialog::dragEnterEvent() * qSlicerFileDialog::dropEvent() By default, qSlicerDataDialog supports drag&drop. Issue 0003081 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21904 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Base/QTGUI/qSlicerDataDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerDataDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerDataDialog_p.h | Diff File | ||
mod - Base/QTGUI/qSlicerFileDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerFileDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerIOManager.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerIOManager.h | Diff File | ||
mod - Base/QTGUI/qSlicerModelsDialog.h | Diff File | ||
Slicer: 2145-support-for-installing-extension-from-file 35b30817 2013-04-29 10:12:03 Details Diff |
ENH: Add qSlicerScriptedFileDialog * Add qSlicerFileDialog::description * Add input dialog to select reader when multiple readers accept the same mime data How to create a FileDialog in python? +class XYZFileDialog: + def __init__(self, parent): + self.parent = parent + parent.fileType = 'XYZ' + parent.description = 'XYZ' + parent.action = slicer.qSlicerFileDialog.Read + def isMimeDataAccepted(self): + accept = self.parent.mimeData().hasFormat("text/uri-list") + self.parent.acceptMimeData(accept) + def dropEvent(self): + self.parent.dropEvent().accept() + def execDialog(self): + print 'exec' How to order the list (make the module reader by default): Make the module depend on "Data" -> instantiated after "Data" module def __init__(self, parent): + parent.dependencies = ["Data"] Issue 0003081 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21951 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Base/QTCore/qSlicerCoreApplication.cxx | Diff File | ||
mod - Base/QTGUI/CMakeLists.txt | Diff File | ||
mod - Base/QTGUI/qSlicerDataDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerDataDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerFileDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerFileDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerIOManager.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerModelsDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerModelsDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerSaveDataDialog.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerSaveDataDialog.h | Diff File | ||
add - Base/QTGUI/qSlicerScriptedFileDialog.cxx | Diff File | ||
add - Base/QTGUI/qSlicerScriptedFileDialog.h | Diff File | ||
mod - Base/QTGUI/qSlicerScriptedLoadableModule.cxx | Diff File | ||
mod - Base/QTGUI/qSlicerScriptedLoadableModule.h | Diff File | ||
Slicer: 2145-support-for-installing-extension-from-file df58ed05 2013-04-29 11:35:13 Details Diff |
COMP: fix duplicate metatype declaration (Issue 0003081) See also r21951 git-svn-id: http://svn.slicer.org/Slicer4/trunk@21953 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Base/QTGUI/qSlicerFileDialog.h | Diff File | ||
Slicer: 2145-support-for-installing-extension-from-file 50b9bcf3 2013-08-07 15:56:35 Details Diff |
ENH: Select DICOM reader by default on drag&drop Issue 0003081 git-svn-id: http://svn.slicer.org/Slicer4/trunk@22267 3bd1e089-480b-0410-8dfb-8563597acbee |
||
mod - Base/QTGUI/qSlicerIOManager.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-04-20 02:39 | kikinis | New Issue | |
2013-04-20 02:39 | kikinis | Status | new => assigned |
2013-04-20 02:39 | kikinis | Assigned To | => finetjul |
2013-04-20 14:10 | finetjul | Note Added: 0008455 | |
2013-04-20 14:11 | finetjul | Assigned To | finetjul => pieper |
2013-04-25 14:32 | pieper | Note Added: 0008501 | |
2013-04-25 15:06 | finetjul | Note Added: 0008505 | |
2013-04-25 15:23 | pieper | Note Added: 0008507 | |
2013-04-25 19:41 | kikinis | Note Added: 0008509 | |
2013-04-26 04:44 | finetjul | Note Added: 0008511 | |
2013-04-26 06:17 | pieper | Note Added: 0008512 | |
2013-04-26 06:38 | finetjul | Note Added: 0008513 | |
2013-04-26 06:48 | pieper | Note Added: 0008514 | |
2013-04-29 06:27 | finetjul | Note Added: 0008533 | |
2013-04-29 06:55 | pieper | Note Added: 0008534 | |
2013-04-29 07:19 | pieper | Note Added: 0008535 | |
2013-04-29 07:31 | finetjul | Note Added: 0008536 | |
2013-04-29 07:36 | pieper | Note Added: 0008537 | |
2013-07-04 14:27 | pieper | Status | assigned => resolved |
2013-07-04 14:27 | pieper | Fixed in Version | => Slicer 4.3.0 |
2013-07-04 14:27 | pieper | Resolution | open => fixed |
2013-08-06 07:19 | kikinis | Note Added: 0009393 | |
2013-08-06 07:19 | kikinis | Status | resolved => feedback |
2013-08-06 07:19 | kikinis | Resolution | fixed => reopened |
2013-08-06 09:01 | pieper | Status | feedback => assigned |
2013-08-06 09:01 | pieper | Assigned To | pieper => finetjul |
2013-08-06 09:02 | pieper | Note Added: 0009406 | |
2013-08-07 11:57 | finetjul | Note Added: 0009425 | |
2013-08-07 11:57 | finetjul | Status | assigned => resolved |
2013-08-07 11:57 | finetjul | Resolution | reopened => fixed |
2013-08-31 04:45 | kikinis | Status | resolved => closed |
2015-11-02 05:47 | jcfr | Relationship added | related to 0003291 |
2017-06-07 23:27 | finetjul | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 50b9bcf3 |
2017-06-07 23:27 | pieper | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file df58ed05 |
2017-06-07 23:27 | finetjul | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file 35b30817 |
2017-06-07 23:27 | finetjul | Changeset attached | => Slicer 2145-support-for-installing-extension-from-file cbcecd95 |