ANTsX / ANTsRCore

Rcpp bindings for the C++ ANTs library used by the ANTsR package
9 stars 9 forks source link

Can't read MNC file #67

Open muschellij2 opened 5 years ago

muschellij2 commented 5 years ago

Should ANTsRCore be able to read in MNC files? If so, tried one out with colin27 minc from http://www.bic.mni.mcgill.ca/ServicesAtlases/Colin27 and got an error.

library(ANTsRCore)
#> 
#> Attaching package: 'ANTsRCore'
#> The following object is masked from 'package:stats':
#> 
#>     var
#> The following objects are masked from 'package:base':
#> 
#>     all, any, apply, max, min, prod, range, sum
destfile = tempfile(fileext = ".zip")
url = "http://packages.bic.mni.mcgill.ca/mni-models/colin27/mni_colin27_1998_minc1.zip"
download.file(url = url, destfile = destfile)

unz = unzip(zipfile = destfile, exdir = tempdir())
img_file = unz[grepl("lin[.]mnc", unz)]

And reading in get an exception:

antsImageRead(img_file)

with the following error

/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/Rtmp33R8iu/R.INSTALL130672b38673/ITKR/src/itks/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c:1400 (from MINC): Unable to open file '/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpcMWu95/colin27_t1_tal_lin.mnc'
ExceptionObject caught !

itk::ExceptionObject (0x7f965a3324e8)
Location: "unknown" 
File: /private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/Rtmp33R8iu/R.INSTALL130672b38673/ITKR/src/itks/Modules/IO/MINC/src/itkMINCImageIO.cxx
Line: 301
Description: itk::ERROR: MINCImageIO(0x7f965a30ca50): Could not open file "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpcMWu95/colin27_t1_tal_lin.mnc".

libc++abi.dylib: terminating with uncaught exception of type Rcpp::exception: ITK exception caught
Abort trap: 6

Created on 2018-11-07 by the reprex package (v0.2.1)

stnava commented 5 years ago

I don’t think we enable this in the ITKR make flags.

No one has mentioned this previously.

@gdevenyi Do you think there is any interest?

On Wed, Nov 7, 2018 at 6:15 PM John Muschelli notifications@github.com wrote:

Should ANTsRCore be able to read in MNC files? If so, tried one out with colin27 minc from http://www.bic.mni.mcgill.ca/ServicesAtlases/Colin27 and got an error.

library(ANTsRCore)#> #> Attaching package: 'ANTsRCore'#> The following object is masked from 'package:stats':#> #> var#> The following objects are masked from 'package:base':#> #> all, any, apply, max, min, prod, range, sumdestfile = tempfile(fileext = ".zip")url = "http://packages.bic.mni.mcgill.ca/mni-models/colin27/mni_colin27_1998_minc1.zip" download.file(url = url, destfile = destfile) unz = unzip(zipfile = destfile, exdir = tempdir())img_file = unz[grepl("lin[.]mnc", unz)]

And reading in get an exception:

antsImageRead(img_file)

with the following error

/private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/Rtmp33R8iu/R.INSTALL130672b38673/ITKR/src/itks/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c:1400 (from MINC): Unable to open file '/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpcMWu95/colin27_t1_tal_lin.mnc' ExceptionObject caught !

itk::ExceptionObject (0x7f965a3324e8) Location: "unknown" File: /private/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T/Rtmp33R8iu/R.INSTALL130672b38673/ITKR/src/itks/Modules/IO/MINC/src/itkMINCImageIO.cxx Line: 301 Description: itk::ERROR: MINCImageIO(0x7f965a30ca50): Could not open file "/var/folders/1s/wrtqcpxn685_zk570bnx9_rr0000gr/T//RtmpcMWu95/colin27_t1_tal_lin.mnc".

libc++abi.dylib: terminating with uncaught exception of type Rcpp::exception: ITK exception caught Abort trap: 6

Created on 2018-11-07 by the reprex package https://reprex.tidyverse.org (v0.2.1)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsRCore/issues/67, or mute the thread https://github.com/notifications/unsubscribe-auth/AATyfk6oXDy6pbUKTh-yrl4N8_7V78cOks5us2mlgaJpZM4YTsV5 .

--

brian

gdevenyi commented 5 years ago

We are most certainly interested in ANTsR supporting MINC. We recently had some discussions on the RMINC github regarding moving closer to the ITK reader family to support more filetypes and one option brought up was to use the ANTsR core https://github.com/Mouse-Imaging-Centre/RMINC/issues/239

vfonov commented 5 years ago

It's in MINC1 format. ITK (if using built-in MINC IO ) is only able to read/write MINC2 files.