Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add renamed const buffer access methods to C# interface. #961

Merged

Conversation

blowekamp
Copy link
Member

The implicit modification of the image by calling MakeUnique can cause
problem in with multi-threader. See issue #958 for more details.

@blowekamp blowekamp force-pushed the AddConstBufferMethodForCSharp branch from df74b21 to 2f78607 Compare January 31, 2020 22:19
@vincenzoml
Copy link

I've tested this fix and it works. This resolves the problems raised in issue #961.

@@ -43,6 +43,24 @@
%CSharpTypemapHelper( float*, System.IntPtr )
%CSharpTypemapHelper( double*, System.IntPtr )


// CSharp does not hadle overloaded const methods. So they are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'handle'

Copy link
Member

@zivy zivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor edit on code comment.

// explicitly renamed to enable their explicit usage. These methods
// assume that the buffer is will not be modified, so MakeUnique is
// not call.
%rename("GetConstBufferAsInt8") itk::simple::Image::GetBufferAsInt8( ) const;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// assume that the buffer is will not be modified, so MakeUnique is
// not call.

change to:
// assume that the buffer will not be modified, so MakeUnique is
// not called.

The implicit modification of the sitk::Image by calling MakeUnique in
the GetBufferAs.. methods can cause problem in with
multi-threader. See issue SimpleITK#958 for more details.
@blowekamp blowekamp force-pushed the AddConstBufferMethodForCSharp branch from cec52f2 to 8054ae5 Compare February 5, 2020 17:41
@blowekamp blowekamp merged commit 6fa70dc into SimpleITK:master Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants