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

Removing ImageMath dependency #53

Closed
stnava opened this issue Jun 9, 2015 · 15 comments
Closed

Removing ImageMath dependency #53

stnava opened this issue Jun 9, 2015 · 15 comments

Comments

@stnava
Copy link
Member

stnava commented Jun 9, 2015

@jeffduda @bkandel

ANTsR will be "broken" for a while ... Being tired of this ongoing issue, I did the aggressive thing and removed imageMath and src/ImageMath.cpp and also updated the antstag s.t. ImageMath is not compiled in core. here are the current issues:

* checking R code for possible problems ... NOTE
aslCensoring : aslOutlierRejection: no visible global function
  definition for ‘imageMath’
basicInPaint: no visible global function definition for ‘imageMath’
compcor: no visible global function definition for ‘imageMath’
getCentroids: no visible global function definition for ‘imageMath’
getTemplateCoordinates: no visible global function definition for
  ‘imageMath’
projectImageAlongAxis: no visible global function definition for
  ‘imageMath’
sliceTimingCorrection: no visible global function definition for
  ‘imageMath’
* checking Rd files ... OK

relating to:

ANTsR/R/aslCensoring.R:    imageMath(4, diffs, "TimeSeriesSimpleSubtraction", asl)
ANTsR/R/basicInPaint.R:  imageMath(img@dimension, temp, "MD", temp, 1)
ANTsR/R/basicInPaint.R:  # imageMath(img@dimension,paintMaskUse,'GD',paintMask,1)
ANTsR/R/basicInPaint.R:  imageMath(inpainted@dimension, inpainted, "FastMarchingExtension", speedimage,
ANTsR/R/compcor.R:    imageMath(4, myoutfn, "CompCorrAuto", fmri, mask, ncompcor)
ANTsR/R/getCentroids.R:  imageMath(imagedim, pointfile, "LabelStats", img, img, clustparam)
ANTsR/R/getTemplateCoordinates.R:  imageMath(milab@dimension, pointfile, "LabelStats",
ANTsR/R/pairwiseImageDistanceMatrix.R:        # broken !!  metric <- capture.output(imageMath(dim, 'j', metrictype, i1,
ANTsR/R/projectImageAlongAxis.R:  imageMath(imageND@dimension, downimg, "Project", imageND, axis, projtype)
ANTsR/R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
ANTsR/R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
ANTsR/R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime)

here is a commit that deals with some of these:

3713fd8

however it would be good to get the rest as well ...

@jeffduda a few pieces of functionality in iMath

  • Project operator from ImageMath
  • FastMarchingExtension

@bkandel add x, y, z, t to labelStats ... the output is always 4D centroids ... e.g. in 2D it will contain x_i, y_i, 0, 0 ( or maybe NA, NA ) ....

the other issues should be self explanatory.

@bkandel
Copy link
Collaborator

bkandel commented Jun 9, 2015

sounds good. i already fixed the aslCensoring dependency, just waiting on
test suite to run before committing.

for the labelStats xyz coords, should i just use the raw output from
labelgeometryimagefilter, or is there some other space that the coordinates
should be drawn from?

2015-06-09 11:47 GMT-04:00 stnava notifications@github.com:

@jeffduda https://github.com/jeffduda @bkandel
https://github.com/bkandel

ANTsR will be "broken" for a while ... Being tired of this ongoing issue,
I did the aggressive thing and removed imageMath and src/ImageMath.cpp and
also updated the antstag s.t. ImageMath is not compiled in core. here are
the current issues:

  • checking R code for possible problems ... NOTE
    aslCensoring : aslOutlierRejection: no visible global function
    definition for ‘imageMath’
    basicInPaint: no visible global function definition for ‘imageMath’
    compcor: no visible global function definition for ‘imageMath’
    getCentroids: no visible global function definition for ‘imageMath’
    getTemplateCoordinates: no visible global function definition for
    ‘imageMath’
    projectImageAlongAxis: no visible global function definition for
    ‘imageMath’
    sliceTimingCorrection: no visible global function definition for
    ‘imageMath’
  • checking Rd files ... OK

relating to:

ANTsR/R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction", asl)
ANTsR/R/basicInPaint.R: imageMath(img@dimension, temp, "MD", temp, 1)
ANTsR/R/basicInPaint.R: # imageMath(img@dimension,paintMaskUse,'GD',paintMask,1)
ANTsR/R/basicInPaint.R: imageMath(inpainted@dimension, inpainted, "FastMarchingExtension", speedimage,
ANTsR/R/compcor.R: imageMath(4, myoutfn, "CompCorrAuto", fmri, mask, ncompcor)
ANTsR/R/getCentroids.R: imageMath(imagedim, pointfile, "LabelStats", img, img, clustparam)
ANTsR/R/getTemplateCoordinates.R: imageMath(milab@dimension, pointfile, "LabelStats",
ANTsR/R/pairwiseImageDistanceMatrix.R: # broken !! metric <- capture.output(imageMath(dim, 'j', metrictype, i1,
ANTsR/R/projectImageAlongAxis.R: imageMath(imageND@dimension, downimg, "Project", imageND, axis, projtype)
ANTsR/R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
ANTsR/R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
ANTsR/R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime)

here is a commit that deals with some of these:

3713fd8
3713fd8

however it would be good to get the rest as well ...

@jeffduda https://github.com/jeffduda a few pieces of functionality in
iMath

Project operator from ImageMath

FastMarchingExtension

@bkandel https://github.com/bkandel add x, y, z, t to labelStats ...
the output is always 4D centroids ... e.g. in 2D it will contain x_i, y_i,
0, 0 ( or maybe NA, NA ) ....

the other issues should be self explanatory.


Reply to this email directly or view it on GitHub
#53.

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

i forgot about labelGeometryMeasures, in part because it was broken. so i will fix the calls to labelStats by using this instead. so never mind about labelStats ....

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

done.

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R:    imageMath(4, diffs, "TimeSeriesSimpleSubtraction", asl)
R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R:    imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime)

@jeffduda
Copy link
Collaborator

jeffduda commented Jun 9, 2015

We should probably just get rid of sliceTimingCorrection.R for now. It
makes a number of assumption which aren't true for data that is currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction", asl)
R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected, "SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
#53 (comment).

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching extension ?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda notifications@github.com
wrote:

We should probably just get rid of sliceTimingCorrection.R for now. It
makes a number of assumption which aren't true for data that is currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction", asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@jeffduda
Copy link
Collaborator

jeffduda commented Jun 9, 2015

I can work on those today.

On Tue, Jun 9, 2015 at 3:10 PM stnava notifications@github.com wrote:

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching extension ?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda notifications@github.com
wrote:

We should probably just get rid of sliceTimingCorrection.R for now. It
makes a number of assumption which aren't true for data that is currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction",
asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@jeffduda
Copy link
Collaborator

jeffduda commented Jun 9, 2015

rather than make "project" part of iMath, i wrote apply.antsImage. This has
the advantage of being much more R-like and allowing an arbitrary function
to be used for the projection. It's just a wrapper for apply that handles
the header info.

On Tue, Jun 9, 2015 at 3:13 PM Jeffrey Duda jeff.duda@gmail.com wrote:

I can work on those today.

On Tue, Jun 9, 2015 at 3:10 PM stnava notifications@github.com wrote:

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching extension ?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda notifications@github.com
wrote:

We should probably just get rid of sliceTimingCorrection.R for now. It
makes a number of assumption which aren't true for data that is
currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction",
asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

that makes sense, of course. probably very useful if we can figure out
what to do with it.

one issue is how to take care of the header info - guess you can wrap that
into apply.

brian

On Tue, Jun 9, 2015 at 5:15 PM, Jeffrey Duda notifications@github.com
wrote:

rather than make "project" part of iMath, i wrote apply.antsImage. This has
the advantage of being much more R-like and allowing an arbitrary function
to be used for the projection. It's just a wrapper for apply that handles
the header info.

On Tue, Jun 9, 2015 at 3:13 PM Jeffrey Duda jeff.duda@gmail.com wrote:

I can work on those today.

On Tue, Jun 9, 2015 at 3:10 PM stnava notifications@github.com wrote:

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching extension
?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda notifications@github.com
wrote:

We should probably just get rid of sliceTimingCorrection.R for now. It
makes a number of assumption which aren't true for data that is
currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com
wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs, "TimeSeriesSimpleSubtraction",
asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@stnava
Copy link
Member Author

stnava commented Jun 9, 2015

looks like FastMarchingExtension may be the only thing left ... that may
also be better off in a separate location than iMath ...

brian

On Tue, Jun 9, 2015 at 5:18 PM, brian avants stnava@gmail.com wrote:

that makes sense, of course. probably very useful if we can figure out
what to do with it.

one issue is how to take care of the header info - guess you can wrap that
into apply.

brian

On Tue, Jun 9, 2015 at 5:15 PM, Jeffrey Duda notifications@github.com
wrote:

rather than make "project" part of iMath, i wrote apply.antsImage. This
has
the advantage of being much more R-like and allowing an arbitrary function
to be used for the projection. It's just a wrapper for apply that handles
the header info.

On Tue, Jun 9, 2015 at 3:13 PM Jeffrey Duda jeff.duda@gmail.com wrote:

I can work on those today.

On Tue, Jun 9, 2015 at 3:10 PM stnava notifications@github.com wrote:

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching
extension ?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda <notifications@github.com

wrote:

We should probably just get rid of sliceTimingCorrection.R for now.
It
makes a number of assumption which aren't true for data that is
currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com
wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs,
"TimeSeriesSimpleSubtraction",
asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
<#53 (comment)
.


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@jeffduda
Copy link
Collaborator

jeffduda commented Jun 9, 2015

Was thinking the same. Will make it, it's own .cpp

On Tue, Jun 9, 2015 at 5:29 PM stnava notifications@github.com wrote:

looks like FastMarchingExtension may be the only thing left ... that may
also be better off in a separate location than iMath ...

brian

On Tue, Jun 9, 2015 at 5:18 PM, brian avants stnava@gmail.com wrote:

that makes sense, of course. probably very useful if we can figure out
what to do with it.

one issue is how to take care of the header info - guess you can wrap
that
into apply.

brian

On Tue, Jun 9, 2015 at 5:15 PM, Jeffrey Duda notifications@github.com
wrote:

rather than make "project" part of iMath, i wrote apply.antsImage. This
has
the advantage of being much more R-like and allowing an arbitrary
function
to be used for the projection. It's just a wrapper for apply that
handles
the header info.

On Tue, Jun 9, 2015 at 3:13 PM Jeffrey Duda jeff.duda@gmail.com
wrote:

I can work on those today.

On Tue, Jun 9, 2015 at 3:10 PM stnava notifications@github.com
wrote:

i am ok with that and will implement now.

any thoughts on the other 2: (1) projection (2) fast marching
extension ?

brian

On Tue, Jun 9, 2015 at 2:46 PM, Jeffrey Duda <
notifications@github.com

wrote:

We should probably just get rid of sliceTimingCorrection.R for now.
It
makes a number of assumption which aren't true for data that is
currently
being collected.

On Tue, Jun 9, 2015 at 1:43 PM stnava notifications@github.com
wrote:

Remaining issues

MacBook-Pro:ANTsR stnava$ grep imageMath R/*
R/aslCensoring.R: imageMath(4, diffs,
"TimeSeriesSimpleSubtraction",
asl)
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime, interpolation,
R/sliceTimingCorrection.R: imageMath(4, corrected,
"SliceTimingCorrection", fmri, sliceTime)


Reply to this email directly or view it on GitHub
<
#53 (comment)
.


Reply to this email directly or view it on GitHub
<#53 (comment)
.


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).


Reply to this email directly or view it on GitHub
#53 (comment).

@stnava
Copy link
Member Author

stnava commented Jun 10, 2015

added some documentation to FastMarchingExtension and updated basicInPaint ...

not sure the documentation has the right usage of the mask ... you might want clean that up / make sure it works with an example .... if you get a chance to do so, let me know.

@jeffduda
Copy link
Collaborator

Looks like apply isn't a generic so we can't make it work like we do with
plot, but as it is, apply.antsImage should handle all the header info and
work the same as a call to apply with an array

On Wed, Jun 10, 2015 at 10:04 AM stnava notifications@github.com wrote:

added some documentation to FastMarchingExtension and updated basicInPaint
...

not sure the documentation has the right usage of the mask ... you might
want clean that up / make sure it works with an example .... if you get a
chance to do so, let me know.


Reply to this email directly or view it on GitHub
#53 (comment).

@stnava
Copy link
Member Author

stnava commented Jun 10, 2015

this is pretty close to done ... will close the issue once we get both codeship and travis passing ...

@stnava
Copy link
Member Author

stnava commented Jun 11, 2015

fixed an example bug. this appears to be ready to close now.

@stnava stnava closed this as completed Jun 11, 2015
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

No branches or pull requests

3 participants