[vtkusers] Problem with some frequent error in vtk or maybe in Visual Studio 7 .NET 2003

Łukasz Tutaj ltutaj at wp.pl
Wed Aug 3 07:50:48 EDT 2005


Hi vtk Users.

    I use Visual Studio 7 .NET 2003 in my programming work. I write some 
programs for transforming and displaying medical data. In many different 
cases I get some error: Unhandled exception at 0x10216393 (msvcr71d.dll) 
in DicomRead2.exe: 0xC0000005: Access violation writing location 
0x0b6b1000. After debugging I've got to know that the problem appears 
always in memcpy.asm file in part of code:
/////////////////////
        CopyUp:
        test    edi,11b         ;U - destination dword aligned?
        jnz     short CopyLeadUp ;V - if we are not dword aligned 
already, align

        shr     ecx,2           ;U - shift down to dword count
        and     edx,11b         ;V - trailing byte count

        cmp     ecx,8           ;U - test if small enough for unwind copy
        jb      short CopyUnwindUp ;V - if so, then jump

        rep     movsd           ;N - move all of our dwords            
  * <---- here the error appears*

        jmp     dword ptr TrailUpVec[edx*4] ;N - process trailing bytes
/////////////////

I have this error in this simple program. Using example data from 
...\\Data\\headsq\\quarter directory everything is fine, but using DICOM 
files from ...\\dane100 I always get mentioned above error. In many 
cases my programs work for example data ...\\Data\\headsq\\quarter 
directory (providing by vtk authors) but error appears when I put as 
input DICOM files.
Thanks for any help.

Łukasz


/////////////////
#include "vtkImageViewer2.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageReader.h"
#include "vtkRenderWindowInteractor.h"
#define T 1

//#include "vtkTestUtilities.h"
//#include "vtkRegressionTestImage.h"

int main( int argc, char *argv[] )
{
#if T
    vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
        reader->SetDirectoryName("D:\\PRACA MAGISTERSKA\\dane100"); // 
Some DICOM files
#else
    vtkImageReader *reader = vtkImageReader::New();
        reader->ReleaseDataFlagOff();
        reader->SetDataByteOrderToLittleEndian();
        reader->SetDataExtent(0,63,0,63,0,92);
        reader->SetDataSpacing(3.2,3.2,1.5);
        reader->SetFilePrefix("D:\\PRACA 
MAGISTERSKA\\Data\\headsq\\quarter");
        reader->SetDataMask(0x7fff);
#endif
        vtkImageViewer2 *viewer = vtkImageViewer2::New();
        viewer->SetInput(reader->GetOutput());
        vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
        viewer->SetupInteractor(iren);
        viewer->SetZSlice(45);
        viewer->SetColorLevel(1000);
        viewer->SetColorWindow(2000);
        iren->Initialize();
        iren->Start();
       
        reader->Delete();
        iren->Delete();
        viewer->Delete();
    return 0;
}
//////////////////////





More information about the vtkusers mailing list