Hi Miklos,

inserting further if-condition like the other two will solve your problem. The 
ImageWriter checks for .pic or .nrrd file extension at this place, because of 
the support for 3D+t like you wrote. You also need to handle writing of the 
".hdr" case few lines below separately, e.g. here

215 if(m_Extension.find(".nrrd") ...

Best,
Jan


On Sep 7, 2011, at 7:36 PM, Miklos Espak wrote:

> I investigated a bit.
> The problem is with the mitkImageWriter.cpp that contains a code
> segment like this:
> 
>  // If the extension is NOT .pic and NOT .nrrd the following block is entered
>  if ( m_Extension.find(".pic") == std::string::npos
>       && m_Extension.find(".nrrd") == std::string::npos)
>  {
>    if(input->GetDimension() > 3)
>    {
>      int t, timesteps;
> 
>      timesteps = input->GetDimension(3);
>   ...
> 
> So 3D+t images are split into 3D images and then saved one by one.
> What is the motivation behind this? I suppose you wanted to split only
> those image formats that do not support 4D images. If yes, I would
> suggest to add the ".hdr" extension to the "if" condition.
> 
> Could somebody confirm this?
> 
> Thanks,
> Miklos
> 
> On Wed, Sep 7, 2011 at 4:45 PM, Miklos Espak <[email protected]> wrote:
>> I see. My case is different then.
>> 
>> After that I registered the NiftiImageIOFactory by
>>    itk::NiftiImageIOFactory::RegisterOneFactory();
>> I coul read and write images by the built-in mitk::ItkImageFileReader
>> and mitk::ItkImageFileWriter, respectively. (Even the series reader
>> works.)
>> 
>> I mean, this works through the API. Opening a 3D/3D+t image from the
>> GUI also works, the only thing is that I have to choose "all" instead
>> of "known extension" because the ".hdr" extension is not listed.
>> 
>> The bigger problem is saving via the datamanager view context menu.
>> Even if saving through API works, when I use the menu item then a
>> series of images is saved, and a warning is displayed about that.
>> 
>> I am afraid that this should be fixed in either the menu action or the
>> built-in object factories. I did not debug it, though.
>> 
>> Miklos
>> 
>> On Tue, Sep 6, 2011 at 11:14 PM, Clarkson, Matt <[email protected]> wrote:
>>> Hi Miklos,
>>> 
>>> Using the documents here: http://www.mitk.org/wiki/BugSquashingSeminars, 
>>> and specifically the "Defining your own MITK Datatypes" it was quite easy 
>>> to create the necessary Factory classes to create a reader for a specific 
>>> file format, and to have the file extensions appear in the Load/Save dialog 
>>> boxes.
>>> 
>>> However, my problem was that I wanted to NOT use the standard ITK Analyze 
>>> reader, which meant replacing the mitkItkImageFileReader, and replace it 
>>> with a modified version.
>>> This turns out to be a bit trickier, as you would have to unregister the 
>>> MITK provided one, and provide your own.
>>> 
>>> However, we could just ask for .img and .img.gz to be added to the file 
>>> dialog box (via mitkCoreObjectFactory.cpp), as this would probably suffice 
>>> for most people, and the image would be read using the standard 
>>> mitkImageFileReader.h
>>> 
>>> Can you remind me again, why did you have to register a new Nifti file 
>>> reader when ITK and hence MITK already had one?
>>> 
>>> Matt
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> On 6 Sep 2011, at 17:09, Miklos Espak wrote:
>>> 
>>>> Hi,
>>>> 
>>>> if I save a 3D+t image through the GUI (datamanager view context
>>>> menu), a series of images is saved instead of a single image.
>>>> 
>>>> I would like to use the Analyze format (.hdr + .img), it is not
>>>> offered by the save dialog, so I chose Nifti.
>>>> 
>>>> I registered the itk::NiftiImageIOFactory, and from the sources I can
>>>> open and save 3D+t images properly. Is there a way to get around this?
>>>> 
>>>> Matt!
>>>> Have you succeeded with adding hdr to the open/save dialog?
>>>> 
>>>> Thanks,
>>>> Miklos
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Special Offer -- Download ArcSight Logger for FREE!
>>>> Finally, a world-class log management solution at an even better
>>>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>>>> download Logger. Secure your free ArcSight Logger TODAY!
>>>> http://p.sf.net/sfu/arcsisghtdev2dev
>>>> _______________________________________________
>>>> mitk-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>>> 
>>> 
>> 
> 
> ------------------------------------------------------------------------------
> Using storage to extend the benefits of virtualization and iSCSI
> Virtualization increases hardware utilization and delivers a new level of
> agility. Learn what those decisions are and how to modernize your storage 
> and backup environments for virtualization.
> http://www.accelacomm.com/jaw/sfnl/114/51434361/
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to