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

For R add conversion for an R list of Transforms to a VectorOfTransform #1129

Open
blowekamp opened this issue Jun 8, 2020 · 3 comments
Open
Assignees
Milestone

Comments

@blowekamp
Copy link
Member

A follow up patch needs to be made to #1124, that adds conversion from R list to the needed SWIG'ed wrapped class. For example the following should work:

txList <- c(outTx1, displacementTx)
outTx <- CompositeTransform(txList)

or

VectorOfTransform(c(Transform(), AffineTransform(2))
@blowekamp
Copy link
Member Author

I tried adapting to Transforms the following code:

SimpleITK/Wrapping/R/R.i

Lines 83 to 97 in c89eeda

%typemap("rtype") std::vector<itk::simple::Image>, std::vector<itk::simple::Image>& "list";
%typemap("rtypecheck") std::vector<itk::simple::Image>, std::vector<itk::simple::Image>&
%{
(is.list($arg) & all(sapply($arg, inherits, what='_p_itk__simple__Image')))
%}
%typemap("scoercein") std::vector<itk::simple::Image>, std::vector<itk::simple::Image>&
%{
$input=ImListToVec($input);
$input=slot($input, "ref")
%}
%typemap("scoerceout") std::vector<itk::simple::Image>, std::vector<itk::simple::Image>&
%{
$result=ImportSwigVec($result);
%}

Without any success.

@zivy
Copy link
Member

zivy commented Apr 13, 2023

Hi @richardbeare , any chance you can take a stab at this one. Thanks!

@richardbeare
Copy link
Contributor

I'll try to make time - I obviously forgot about it after it first came up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants