Code Monkey home page Code Monkey logo

Comments (7)

bkandel avatar bkandel commented on August 25, 2024

Can you provide the images you were using?

2015-06-10 17:14 GMT-04:00 BrysonBR [email protected]:

I just installed ANTsR and the problem I am having is with
abpBrainExtraction.
I enter the following commands in R in terminal:

struct<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MPRAGE.nii.gz")
tem<-antsImageRead("/Users/Bryson/Data/ANTsR_test/bet.nii.gz")
temmask<-antsImageRead("/Users/Bryson/Data/ANTsR_test/bet_mask.nii.gz")

bm<-abpBrainExtraction(img=struct,tem=tem,temmask=temmask)

And I get the following error:
Problem in arg list
see usage by calling antsApplyTransforms() w/o arguments
Error in thresholdImage(temmaskwarped, 0.5, 1) :
trying to get slot "dimension" from an object of a basic class ("numeric")
with no slots

So I called antsApplyTransforms() w/o arguments, but it wasn't helpful to
me:

antsApplyTransforms()
warpedimg<-antsApplyTransforms( fixed=img1 , moving=img2 ,
transformlist=list("my0GenericAffine.mat","my1Warp.nii.gz") )

For full mode: use standard ants call as in antsApplyTransforms full mode
...

antsApplyTransforms("-d","2","-i","r64slice.nii.gz","-o","temp.nii.gz","-r","r16slice.nii.gz","-t","./Z0GenericAffine.mat")

for full help:
use .Call( "antsApplyTransforms", .int_antsProcessArguments(
c(list("--help")) ), PACKAGE="ANTsR" );

[1] 0

The "img" image is a MPRAGE from the ABIDE dataset.
The "tem" image is the bet brain extracted version of the same image(I
wasn't sure what to put here).
And the "temmask" is the brain mask output from bet.
I've run the example in the manual and it runs fine. Also, I tried running
abpBrainExtraction.R another time, and although it didn't give me good
results (probably from a bad choice of the "tem" image), it did finish
without errors. Any ideas on what I can do?


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

from antsr.

stnava avatar stnava commented on August 25, 2024

for antsApplyTransforms , try ?antsApplyTransforms

the template should be the whole head, just like the raw T1

the mask should be the template's brain mask

this function is a fast approximation to https://github.com/stnava/ANTs/blob/master/Scripts/antsBrainExtraction.sh which has been evaluated more thoroughly

you might also try getMask which on occasion can work well despite its simplicity ....

from antsr.

stnava avatar stnava commented on August 25, 2024

also - just updated the documentation

https://github.com/stnava/ANTsR/blob/master/man/abpBrainExtraction.Rd#L10-L12

from antsr.

BrysonBR avatar BrysonBR commented on August 25, 2024

Thank you both for your quick responses. The link below has all of the files that I used originally and others which will be explained below.
https://drive.google.com/open?id=0B9oWACI5TJOEfm1KdzAxSG5IdlNZR3QyOEtGa3l2ZEVETHBUQXZyNDJGUGk5YXRNT2N4blk&authuser=0

First, in response to the extended explanation of the tem and temmask variables, I decided to re-run with the following code:

struct<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP1.nii.gz")
struct<-abpN4(struct)
tem<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP3.nii.gz")
tem<-abpN4(tem)
temmask<-antsImageRead("/Users/Bryson/Data/ANTsR_test/bet_MP3_mask.nii.gz")

bm<-abpBrainExtraction(img=struct,tem=tem,temmask=temmask)

Which resulted in the same error:

Problem in arg list
see usage by calling antsApplyTransforms() w/o arguments
Error in thresholdImage(temmaskwarped, 0.5, 1) :
trying to get slot "dimension" from an object of a basic class ("numeric") with no slots

I also tried getMask, but it did not give me a good result (also in the link).
One more question, how dependent is abpBrainExtraction on the quality of the template's brain extraction?

from antsr.

bkandel avatar bkandel commented on August 25, 2024

I'm getting the same issue...it looks like antsRegistration isn't actually
writing out the transforms it's supposed to. From debugging:
Browse[2]> mytx<-antsRegistration( tem, img, typeofTransform = c('SyN'),

  • initialTransform=initafffn )
    
    Browse[2]> file.exists(mytx$invtransforms[1])
    [1] FALSE

2015-06-11 11:50 GMT-04:00 BrysonBR [email protected]:

Thank you both for your quick responses. The link below has all of the
files that I used originally and others which will be explained below.

https://drive.google.com/open?id=0B9oWACI5TJOEfm1KdzAxSG5IdlNZR3QyOEtGa3l2ZEVETHBUQXZyNDJGUGk5YXRNT2N4blk&authuser=0

First, in response to the extended explanation of the tem and temmask
variables, I decided to re-run with the following code:

struct<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP1.nii.gz")
struct<-abpN4(struct)
tem<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP3.nii.gz")
tem<-abpN4(tem)
temmask<-antsImageRead("/Users/Bryson/Data/ANTsR_test/bet_MP3_mask.nii.gz")

bm<-abpBrainExtraction(img=struct,tem=tem,temmask=temmask)

Which resulted in the same error:

Problem in arg list
see usage by calling antsApplyTransforms() w/o arguments
Error in thresholdImage(temmaskwarped, 0.5, 1) :
trying to get slot "dimension" from an object of a basic class ("numeric")
with no slots

I also tried getMask, but it did not give me a good result (also in the
link).
One more question, how dependent is abpBrainExtraction on the quality of
the template's brain extraction?


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

from antsr.

stnava avatar stnava commented on August 25, 2024

might try verbose output to get some insight

brian

On Thu, Jun 11, 2015 at 12:22 PM, bkandel [email protected] wrote:

I'm getting the same issue...it looks like antsRegistration isn't actually
writing out the transforms it's supposed to. From debugging:
Browse[2]> mytx<-antsRegistration( tem, img, typeofTransform = c('SyN'),

  • initialTransform=initafffn )
    Browse[2]> file.exists(mytx$invtransforms[1])
    [1] FALSE

2015-06-11 11:50 GMT-04:00 BrysonBR [email protected]:

Thank you both for your quick responses. The link below has all of the
files that I used originally and others which will be explained below.

https://drive.google.com/open?id=0B9oWACI5TJOEfm1KdzAxSG5IdlNZR3QyOEtGa3l2ZEVETHBUQXZyNDJGUGk5YXRNT2N4blk&authuser=0

First, in response to the extended explanation of the tem and temmask
variables, I decided to re-run with the following code:

struct<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP1.nii.gz")
struct<-abpN4(struct)
tem<-antsImageRead("/Users/Bryson/Data/ANTsR_test/MP3.nii.gz")
tem<-abpN4(tem)

temmask<-antsImageRead("/Users/Bryson/Data/ANTsR_test/bet_MP3_mask.nii.gz")

bm<-abpBrainExtraction(img=struct,tem=tem,temmask=temmask)

Which resulted in the same error:

Problem in arg list
see usage by calling antsApplyTransforms() w/o arguments
Error in thresholdImage(temmaskwarped, 0.5, 1) :
trying to get slot "dimension" from an object of a basic class
("numeric")
with no slots

I also tried getMask, but it did not give me a good result (also in the
link).
One more question, how dependent is abpBrainExtraction on the quality of
the template's brain extraction?


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


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

from antsr.

stnava avatar stnava commented on August 25, 2024

several "interesting" things going on here ...

  • you are a victim of this issue which is rooted in ITK
  • good news is that issue will be resolved soon thanks to @hjmjohnson finally killing this evil curse
  • bad news is the fix is not yet in ....
  • more good news is that i added a verbose option to antsRegistration in ANTsR to help us debug issues like this more easily
  • bad news is there was another bug in antsRegistration (in ANTs, not ANTsR) which this issue uncovered ...
  • good news is that bug is fixed ....
  • finally - here is a workaround ( command line )
ImageMath 3 MP3close.nii.gz ClosestSimplifiedHeaderMatrix MP3.nii.gz 

then do the work on the close version ... make a close version for each image.

from antsr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.