Coder Social home page Coder Social logo

bic-mni / beast Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fristed/beast

16.0 16.0 6.0 42.17 MB

C implementation of Brain Extraction based on nonlocal Segmentation Technique

Home Page: http://www.bic.mni.mcgill.ca/BEaST

License: GNU General Public License v3.0

C 96.46% CMake 3.54%

beast's People

Contributors

fristed avatar hazedine avatar vfonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beast's Issues

beast_normalize error: No points were chosen by the specified criteria

head.mnc.zip

I am having trouble running beast_normalize on my dataset. I am using minc-toolkit-v2 1.9.16 installed with the supplied singularity container. The command I am running is:

singularity exec ~/singularity/minc-toolkit-1.9.16.simg \
  beast_normalize head.mnc head_mni.mnc tmp/anat2mni.xfm \
  -modeldir /opt/minc/share/icbm152_model_09c

After the "Transforming slices..." step, it exits with the message:

No points were chosen by the specified criteria
resample_labels: crashed while running extracttag (termination status=256)
nu_estimate_np_and_em: crashed while running resample_labels (termination status=256)
nu_correct: crashed while running nu_estimate_np_and_em (termination status=256)

I have attached an example image file that I am using; the scan is derived from a scan in the public domain: TCIA-GBM collection (subject TCGA-12-3650).

How can I debug? Given that it happens with all scans in my database, this must either be a problem with my install or the dataset I am using but I am at a loss as to progress further. I would be grateful for any advice.

#!/bin/bash not in first line of script files

I just built BEaST and noticed that the #!/bin/bash line is not at the correct (first line) position in the beast_normalize and beast_prepareADNIlib files (I'm running the fish shell in my terminals - that's why I noticed this issue).

BeAST doesn't exit with error code on file write failure

Running in a script with "set -e" to stop immediately on error:

Writing a binary volume...
Error creating HDF file '/tmp/tmp.wdSGm0Jpu9/beastmask0.mnc' with mode '2', result -1
HDF5-DIAG: Error detected in HDF5 (1.8.15-patch1) thread 0:
  #000: /opt/quarantine/minc-toolkit/1.9.11/src/build/HDF5/src/H5F.c line 522 in H5Fcreate(): unable to create file
    major: File accessibilty
    minor: Unable to open file
  #001: /opt/quarantine/minc-toolkit/1.9.11/src/build/HDF5/src/H5Fint.c line 1001 in H5F_open(): unable to open file: time = Thu Dec  1 16:45:32 2016
, name = '/tmp/tmp.wdSGm0Jpu9/beastmask0.mnc', tent_flags = 13
    major: File accessibilty
    minor: Unable to open file
  #002: /opt/quarantine/minc-toolkit/1.9.11/src/build/HDF5/src/H5FD.c line 993 in H5FD_open(): open failed
    major: Virtual File Layer
    minor: Unable to initialize object
  #003: /opt/quarantine/minc-toolkit/1.9.11/src/build/HDF5/src/H5FDsec2.c line 343 in H5FD_sec2_open(): unable to open file: name = '/tmp/tmp.wdSGm0Jpu9/beastmask0.mnc', errno = 13, error message = 'Permission denied', flags = 13, o_flags = 242
    major: File accessibilty
    minor: Unable to open file
(from micreate): Unable to create file '/tmp/tmp.wdSGm0Jpu9/beastmask0.mnc'
Error: opening MINC file "/tmp/tmp.wdSGm0Jpu9/beastmask0.mnc".

Script continued to run.

beast_prepareADNIlib error

The minc tool kit that I install with command ('dpkg -i .deb') is located in /opt/minc/1.9.16 (1.9.16 is the version). However, in the beast_prepareADNIlib line 61, it tries to locate 'minc-toolkit-config.sh' under /opt/minc/, but couldn't find it. I can adapt it to my code, but I feel it is desirable to have a more general way to do that.

minc/minc-toolkit-v2/BEaST/nlmsegFuzzy.c(271): error: invalid parallel pragma

I got a pragma error on beast while compiling beast with the minc toolkit v2

On fedora 23

icpc --version
icpc (ICC) 15.0.3 20150407
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.

minc/minc-toolkit-v2/BEaST/nlmsegFuzzy.c(271): error: invalid parallel pragma
        #pragma parallel for reduction(+:count)

... And just commented the line.

MT_USE_OPENMP needs to be undefined if OpenMP is not found

If OpenMP isn't found, a warning is emitted:
https://github.com/BIC-MNI/BEaST/blob/develop/CMakeLists.txt#L97-L106

But there are ifdefs everywhere which will still compile-in openmp calls.

This is my remaining bug for 32bit Centos6, where OpenMP is either broken or cmake can't find it properly:

  35781 -- Could NOT find OpenMP_C (missing: OpenMP_pthread_LIBRARY) (found version "3.1")
  35782 -- Could NOT find OpenMP_CXX (missing: OpenMP_pthread_LIBRARY) (found version "3.1")
  35783 -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
  35784 CMake Warning at CMakeLists.txt:104 (message):
  35785   OpenMP NOT found

And then a linking error because the omp_thread calls were still in the code:

  36035 [ 94%] Building CXX object CMakeFiles/mincbeast.dir/mincbeast.o
  36036 [100%] Linking CXX executable mincbeast
  36037 CMakeFiles/mincbeast.dir/mincbeast.o: In function `main':
  36038 mincbeast.cpp:(.text.startup+0x30): undefined reference to `omp_get_max_threads'
  36039 libbeast.a(beast_lib.o): In function `median_filter(float*, int*, int)':
  36040 beast_lib.cpp:(.text+0x126): undefined reference to `omp_get_max_threads'
  36041 beast_lib.cpp:(.text+0x141): undefined reference to `omp_get_max_threads'
  36042 beast_lib.cpp:(.text+0x1b2): undefined reference to `omp_get_thread_num'
  36043 beast_lib.cpp:(.text+0x409): undefined reference to `omp_get_max_threads'
  36044 libbeast.a(nlmsegFuzzy.o): In function `nlmsegFuzzy4D(float const*, float const*, float const*, float const*, float const*, float const*, int, int, float, float, int const*, int, float*, float*)':
  36045 nlmsegFuzzy.cpp:(.text+0x14): undefined reference to `omp_get_max_threads'
  36046 nlmsegFuzzy.cpp:(.text+0x2b): undefined reference to `omp_get_max_threads'
  36047 nlmsegFuzzy.cpp:(.text+0x42): undefined reference to `omp_get_max_threads'
  36048 nlmsegFuzzy.cpp:(.text+0x13d): undefined reference to `omp_get_max_threads'
  36049 libbeast.a(nlmsegFuzzy.o):nlmsegFuzzy.cpp:(.text+0x362): more undefined references to `omp_get_max_threads' follow
  36050 libbeast.a(nlmsegFuzzy.o): In function `nlmsegFuzzy4D(float const*, float const*, float const*, float const*, float const*, float const*, int, int, float, float, int const*, int, float*, float*)':
  36051 nlmsegFuzzy.cpp:(.text+0x3b3): undefined reference to `omp_get_thread_num'
  36052 nlmsegFuzzy.cpp:(.text+0x3bf): undefined reference to `omp_get_num_threads'
  36053 nlmsegFuzzy.cpp:(.text+0x3ec): undefined reference to `omp_get_thread_num'
  36054 nlmsegFuzzy.cpp:(.text+0x3ff): undefined reference to `omp_get_thread_num'
  36055 nlmsegFuzzy.cpp:(.text+0x412): undefined reference to `omp_get_thread_num'
  36056 nlmsegFuzzy.cpp:(.text+0xb9b): undefined reference to `omp_get_max_threads'
  36057 nlmsegFuzzy.cpp:(.text+0xc8b): undefined reference to `omp_get_max_threads'
  36058 libbeast.a(nlmsegFuzzy.o): In function `nlmsegFuzzy4D_double(float const*, float const*, float const*, float const*, float const*, float const*, int, int, double, double, int const*, int, float*, float*)':
  36059 nlmsegFuzzy.cpp:(.text+0xd8d): undefined reference to `omp_get_max_threads'
  36060 nlmsegFuzzy.cpp:(.text+0xda4): undefined reference to `omp_get_max_threads'
  36061 nlmsegFuzzy.cpp:(.text+0xdbb): undefined reference to `omp_get_max_threads'
  36062 libbeast.a(nlmsegFuzzy.o):nlmsegFuzzy.cpp:(.text+0xeb3): more undefined references to `omp_get_max_threads' follow
  36063 libbeast.a(nlmsegFuzzy.o): In function `nlmsegFuzzy4D_double(float const*, float const*, float const*, float const*, float const*, float const*, int, int, double, double, int const*, int, float*, float*)':
  36064 nlmsegFuzzy.cpp:(.text+0x1129): undefined reference to `omp_get_thread_num'
  36065 nlmsegFuzzy.cpp:(.text+0x1135): undefined reference to `omp_get_num_threads'
  36066 nlmsegFuzzy.cpp:(.text+0x1162): undefined reference to `omp_get_thread_num'
  36067 nlmsegFuzzy.cpp:(.text+0x1178): undefined reference to `omp_get_thread_num'
  36068 nlmsegFuzzy.cpp:(.text+0x118b): undefined reference to `omp_get_thread_num'
  36069 nlmsegFuzzy.cpp:(.text+0x1927): undefined reference to `omp_get_max_threads'
  36070 nlmsegFuzzy.cpp:(.text+0x1a14): undefined reference to `omp_get_max_threads'
  36071 collect2: error: ld returned 1 exit status

mincbeast segmentation fault with newer gcc

When compiling with 9.1.1 (Fedora) the tests fail with a segmentation fault. This does not occur with older versions of gcc (4.8.5 Centos7). It also does not occur when compiling in debug mode. I started doing some digging, and I believe the error occurs during argument parsing, due to this issue.

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.