[Vv] small vv bug

Simon Rit simon.rit at creatis.insa-lyon.fr
Wed Apr 6 13:30:49 CEST 2011


Hi Joel,
I think I found the problem. Exceptions are actually not disabled by
qt. The problem was that vtkImageImport was disabling them. I found a
fix by updating the itk pipeline prior to conversion :
http://cvs.creatis.insa-lyon.fr/viewvc/clitk3/common/vvImage.txx?r1=1.6&r2=1.7
I hope this solves your bug...
Simon

On Tue, Apr 5, 2011 at 5:27 PM, Simon Rit
<simon.rit at creatis.insa-lyon.fr> wrote:
> Hi vv user,
> The code is in vvImageReader.txx around line 150:
>
>    } else {
>      typedef itk::Image< InputPixelType, VImageDimension >
> InputImageType;
>      typedef itk::ImageFileReader<InputImageType> ReaderType;
>      typename ReaderType::Pointer reader = ReaderType::New();
>      reader->SetFileName(mInputFilenames[0]);
>      reader->ReleaseDataFlagOn();
>
>      try {
>        if (mType == IMAGEWITHTIME)
>          mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput(),true);
>        else
>          mImage=vvImageFromITK<VImageDimension,InputPixelType>(reader->GetOutput());
>      } catch ( itk::ExceptionObject & err ) {
>        std::cerr << "Error while reading " <<
> mInputFilenames[0].c_str()
>                  << " " << err << std::endl;
>        std::stringstream error;
>        error << err;
>        mLastError = error.str();
>        return;
>      }
>
> At that point, it has already read the image information successfully.
> Then, it reads the image data and is supposed to handle an exception
> which I think doesn't work with qt... I don't have a quick fix for
> this. Can you raise a bug in our brand new bug tracker?
> http://kingkong.grid.creatis.insa-lyon.fr:9002/projects/vv?jump=users
> You can assign it to anyone you dislike. We'll discuss it during one
> of our regular vv meetings (we had one so far :-)
> Simon
>
> On Tue, Apr 5, 2011 at 5:11 PM, Joel Schaerer <joel.schaerer at gmail.com> wrote:
>> Hi all,
>>
>> I lost quite some time today because vv does not warn the user when it
>> doesn't find the raw file attached to an mhd. Instead, it displays garbage.
>>
>> The function that needs to be fixed is probably vvImageReader::Update.
>> Unfortunately, I don't know ITK well enough to know immediately what
>> needs to be done. Any ideas?
>>
>> joel
>>
>> //------------------------------------------------------------------------------
>> void vvImageReader::Update(LoadedImageType type)
>> {
>>  itk::ImageIOBase::Pointer reader =
>> itk::ImageIOFactory::CreateImageIO(mInputFilenames[0].c_str(),
>> itk::ImageIOFactory::ReadMode);
>>  if (!reader) {
>>    mLastError="Unable to read file.";
>>  } else {
>>    reader->SetFileName(mInputFilenames[0]);
>>    reader->ReadImageInformation();
>>    if (mInputFilenames.size() > 1)
>>
>> Update(reader->GetNumberOfDimensions()+1,reader->GetComponentTypeAsString(reader->GetComponentType()),type);
>>    else
>>
>> Update(reader->GetNumberOfDimensions(),reader->GetComponentTypeAsString(reader->GetComponentType()),type);
>>  }
>> }
>> //------------------------------------------------------------------------------
>>
>> _______________________________________________
>> vv mailing list
>> vv at creatis.insa-lyon.fr
>> http://www.creatis.insa-lyon.fr/mailman/listinfo/vv
>>
>



More information about the vv mailing list