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.20171215.tar.gz" sha256 "16102ece30727900da4ec9eb75bc0ef1030e924aa2f09f3d6251a1335a3d4e39" head "https://github.com/rordenlab/dcm2niix.git" bottle do cellar :any_skip_relocation sha256 "45b3644a820baf951dcaa1f0c39bc089e11486770d621127fa501ef0e6181fde" => :high_sierra sha256 "dc276ad6e059d9fddbc493cd9c380ebddeb248a918193982ec7da5d79628178e" => :sierra sha256 "7aad3796b932e098ee930b5fa4c2331c119cdc24ffd2854a1c761e95aa5b274b" => :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