Hi Martin,

if you take a look at the
Modules/DiffusionImaging/DiffusionCore/IODataStructures/mitkDiffusionCoreObjectFactory.cpp
You can see an example of adding several possible extensions to the dialogue.

The corresponding writer for some of the extensions is
Modules/DiffusionImaging/DiffusionCore/IODataStructures/DiffusionWeightedImages/mitkNrrdDiffusionImageWriter.cpp
Which returns several possible file extensions:

template<typename TPixelType>
std::vector<std::string> 
mitk::NrrdDiffusionImageWriter<TPixelType>::GetPossibleFileExtensions()
{
  std::vector<std::string> possibleFileExtensions;
  possibleFileExtensions.push_back(".dwi");
  possibleFileExtensions.push_back(".hdwi");
  possibleFileExtensions.push_back(".fsl");
  possibleFileExtensions.push_back(".fslgz");
  return possibleFileExtensions;
}

Be aware though, that for most extensions it uses an ITK writer for the actual 
writing part.

Does this help you?

Regards,
Caspar

Von: Martin Tatzber [mailto:[email protected]]
Gesendet: Samstag, 29. Juni 2013 14:13
An: Goch, Caspar Jonas; Zelzer, Sascha
Cc: [email protected]
Betreff: Re: AW: [mitk-users] user input dialog

Hi Caspar!

I looked at the code of the PlanarFigureWriter and encountered a problem. The 
writer is designed to write one file with one extension, which I can see in the 
lines:

    virtual const char * GetDefaultFilename() { return "PlanarFigure.pf"; }
    virtual const char * GetFileDialogPattern() { return "Planar Figure Files 
(*.pf)"; }
    virtual const char * GetDefaultExtension() { return ".pf"; }

But Analyze uses two files with different extensions, img and hdr. How can I 
implement this?

Regards,
Martin

________________________________
Von: "Goch, Caspar Jonas" 
<[email protected]<mailto:[email protected]>>
An: 'Martin Tatzber' 
<[email protected]<mailto:[email protected]>>; "Zelzer, Sascha" 
<[email protected]<mailto:[email protected]>>
CC: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Gesendet: 11:42 Freitag, 21.Juni 2013
Betreff: AW: [mitk-users] user input dialog

Hi Martin,

I believe this is not quite the way Sascha intended the implementation. Usually 
FileWriters have no dependency on any Qmitk code (as you might want to write 
the files using MITK, but not Qt, see [1]).  If you want to look at an example 
implementation the Modules/PlanarFigure/IO/mitkPlanarFigureWriter.h implements 
a writer in this manner. Most file writers in the modules directory derive from 
the mitk::FileWriterWithInformation, if you are looking for more samples (or 
ones not implementing an XML writer).

I hope this helps,
Caspar


[1] http://docs.mitk.org/nightly-qt4/Architecture.html

Von: Martin Tatzber [mailto:[email protected]]
Gesendet: Freitag, 21. Juni 2013 11:08
An: Zelzer, Sascha
Cc: [email protected]<mailto:[email protected]>
Betreff: Re: [mitk-users] user input dialog

Hi Sascha!

I implemented it as a plugin, using the Plugin Generator. I have now a separate 
MITK project including this plugin.
At the moment, it is a button in the GUI, which a user can click to create 
Analyze files out of the selected image.

The class is a subclass of QmitkAbstractView. Does this do the trick if I just 
change the head of the class to

class DcmToAnalyze : public QmitkAbstractView, public 
mitk::FileWriterWithInformation

Regards,
Martin

________________________________
Von: Sascha Zelzer 
<[email protected]<mailto:[email protected]>>
An: Martin Tatzber <[email protected]<mailto:[email protected]>>
CC: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Gesendet: 13:46 Donnerstag, 20.Juni 2013
Betreff: Re: [mitk-users] user input dialog

Hi Martin,

Thanks for your offer to contribute your Analyze converter!

Could you elaborate a little on the way you implemented it? For a contribution, 
it would be ideal if your converter was written as a subclass of 
mitk::FileWriterWithInformation

http://docs.mitk.org/nightly-qt4/classmitk_1_1FileWriterWithInformation.html

which could then be integrated into the existing reader/writer framework and 
also solves the user input problem.

Best,
Sascha

On 06/17/2013 10:46 AM, Martin Tatzber wrote:
Hi guys!

I created a converter from DICOM to Analyze 7.5. At least it was designed as 
this, but it can actually convert any image to Analyze 7.5. Anyway, I want to 
contribute it.

But first, there is one thing that I want to make better: The destination path 
is a fixed string in the source code. How can I make the user choose where to 
save the Analyze files?

Regards,
Martin



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to