# On the error of an itk image pointer assignment

**URL:** <https://discourse.itk.org/t/on-the-error-of-an-itk-image-pointer-assignment/5733>\
**Category:** Engineering\
**Tags:** registration\
**Created:** [February 21, 2023, 10:58am UTC](https://discourse.itk.org/t/on-the-error-of-an-itk-image-pointer-assignment/5733 "2023-02-21T10:58:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Post date:** [February 21, 2023, 10:58am UTC](https://discourse.itk.org/t/on-the-error-of-an-itk-image-pointer-assignment/5733/1 "2023-02-21T10:58:14Z")

</div>

When I pass the itk image between the two classes, random errors will occur in the assignment. Sometimes the code can run normally, sometimes errors will occur, and access conflicts will occur.  
itkimage=myReader-\>GetItkSeriesImage(0);

I checked through the log that the image data was normal before the function returned, but the error occurred during the assignment statement, itk:: MapContainer\<int, ImageType:: Pointer\>itkSeriesImageMap; I also use this class to store itk images. Is it related to this?
