<commit_before>"""
Test ants_image.py

nptest.assert_allclose
self.assertEqual
self.assertTrue

"""

import os
import unittest
from common import run_tests
from context import ants

import numpy as np
import numpy.testing as nptest

import ants

class TestClass_ANTsImage(unittest.TestCase):
    """
    Test ants.ANTsImage class
    """
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_set_direction(self):
        img1 = ants.image_read(ants.get_ants_data('r16'))

        new_direction = np.eye(2)*3
        img1.set_direction(new_direction)

        nptest.assert_allclose(img1.direction, new_direction)


class TestModule_ants_image(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_copy_image_info(self):
        img1 = ants.image_read(ants.get_ants_data('r16'))
        img1.set_spacing((6.9,9.6))
        img1.set_origin((3.6,3.6))

        img2 = ants.image_read(ants.get_ants_data('r64'))

        img3 = ants.copy_image_info(reference=img1, target=img2)

        self.assertEqual(img3.spacing, (6.9,6.9))
        self.assertEqual(img3.origin, (3.6,3.6))


if __name__ == '__main__':
    run_tests()<commit_msg>tests<commit_after>"""
Test ants_image.py

nptest.assert_allclose
self.assertEqual
self.assertTrue

"""

import os
import unittest
from common import run_tests
from context import ants

import numpy as np
import numpy.testing as nptest

import ants

class TestClass_ANTsImage(unittest.TestCase):
    """
    Test ants.ANTsImage class
    """
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_set_direction(self):
        img1 = ants.image_read(ants.get_ants_data('r16'))

        new_direction = np.eye(2)*3
        img1.set_direction(new_direction)

        nptest.assert_allclose(img1.direction, new_direction)


class TestModule_ants_image(unittest.TestCase):

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_copy_image_info(self):
        img1 = ants.image_read(ants.get_ants_data('r16'))
        img1.set_spacing((6.9,9.6))
        img1.set_origin((3.6,3.6))

        img2 = ants.image_read(ants.get_ants_data('r64'))

        img3 = ants.copy_image_info(reference=img1, target=img2)

        self.assertEqual(img3.spacing, (6.9,9.6))
        self.assertEqual(img3.origin, (3.6,3.6))


if __name__ == '__main__':
    run_tests()
{'fraction_non_alphanumeric': 0.11312964492155243, 'fraction_numerical': 0.02972749793559042, 'mean_word_length': 3.0860033726812817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5969426', 'n_tokens_mistral': 885, 'n_tokens_neox': 834, 'n_words': 149}