Hi Sascha, Nice, I wasn't aware of the Read(DataStorage&) method. It does what I need. Except I also need the DataStorage in the writer class, which, afaik, can't access the DataStorage.
As I don't see any alternative, I'll keep my hack as-is for now. It's a singleton in the FiberTracking module. A kind of "service" I guess :) I added a comment in bug #17912, so it got a little attention! Thank you for your help. Nil Le 2015-07-22 02:35, Sascha Zelzer a écrit : > Hi Nil, > > there is a feature request about moving the IDataStorageService class > to a module and make it accessible from a module context (which would > publish it as a service for plugins as well) but it didn't get much > attention yet: http://bugs.mitk.org/show_bug.cgi?id=17912 > > You are talking about an IO module, so assuming you have your own > reader for trk files, there is an overload of IFileReader::Read which > is passed the data storage instance which is to be filled with the > read data. The workbench open file action always calls this method and > allows you inspect the current contents. > > If you are not using your own reader, how are you listening to "load > events" of trk files? > > Best, > Sascha > > On 07/21/2015 08:08 PM, Nil Goyette wrote: >> Hi all, >> >> I know it's possible to access the DataStorage in a view (with >> GetDataStorage) and in a plugin (with the plugin's context and >> IDataStorageService), but I have a special case where I need the >> DataStorage in a IO module. Before you tell me "Don't do that", here's >> my use-case :) >> >> The user loads a .trk file, which may be linked to a reference image, so >> before loading the trk, we check the DataStorage if such an image exists >> and use its affine transformation if it does. Here I say a .trk file, >> but I will have the same problem with surfaces (some are not in world >> position) >> >> I currently handle the situation with a ugly hack, but I would be >> interested in a cleaner solution if there's one. >> Thank you. >> >> Nil ------------------------------------------------------------------------------ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
