37 lines
1.3 KiB
Ruby
37 lines
1.3 KiB
Ruby
class Dcm2niix < Formula
|
|
desc "DICOM to NIfTI converter"
|
|
homepage "https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage"
|
|
url "https://github.com/rordenlab/dcm2niix/archive/v1.0.20171017.tar.gz"
|
|
sha256 "9b121cf37c6103f29e91b2ee1badeafde79323b65173b122bff4d9f2f24daec0"
|
|
head "https://github.com/rordenlab/dcm2niix.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c993f1495499f3eaa47fc348de5a12019199b2cc8a5d375b996c429fcb308840" => :high_sierra
|
|
sha256 "2d0411ecffcb56bbb339eecd8a193986f4fff2960a93a49ceb0167001eb403f0" => :sierra
|
|
sha256 "a1bf7d9932006710ae2c8aaf77c3517a25f13f3e9141d09549c816d95df85678" => :el_capitan
|
|
end
|
|
|
|
option "with-batch"
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
resource "sample.dcm" do
|
|
url "https://raw.githubusercontent.com/dangom/sample-dicom/master/MR000000.dcm"
|
|
sha256 "4efd3edd2f5eeec2f655865c7aed9bc552308eb2bc681f5dd311b480f26f3567"
|
|
end
|
|
|
|
def install
|
|
args = std_cmake_args
|
|
args << "-DBATCH_VERSION=ON" if build.with? "batch"
|
|
system "cmake", ".", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
resource("sample.dcm").stage testpath
|
|
system "#{bin}/dcm2niix", "-f", "%d_%e", "-z", "n", "-b", "y", testpath
|
|
assert_predicate testpath/"localizer_1.nii", :exist?
|
|
assert_predicate testpath/"localizer_1.json", :exist?
|
|
end
|
|
end
|