Ilker Hacihaliloglu

106 papers A* 2A 1B 1C 1Misc 1Journal 66Unranked 34
YearRankTypeTitle / Venue / Authors
2026 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Mohammad R. Salmanpour, Amin Mousavi, Yixi Xu, William B. Weeks, Ilker Hacihaliloglu
2026 J jnl
CoRR
Dina Salama, Mohamed Mahmoud, Nourhan Bayasi, David Liu, Ilker Hacihaliloglu
2026 J jnl
CoRR
Yasamin Medghalchi, Milad Yazdani, AmirHossein Dabiri Aghdam, Moein Heidari, Mojan Izadkhah, Zahra Kavian, Giuseppe Carenini, Lele Wang, Dena Shahriari, Ilker Hacihaliloglu
2025 J jnl
CoRR
Moein Heidari, Ehsan Khodapanah Aghdam, Alexander Manzella, Daniel Hsu, Rebecca Scalabrino, Wenjin Chen, David J. Foran, Ilker Hacihaliloglu
2025 J jnl
CoRR
Morteza Alizadeh, Mehrdad Oveisi, Sonya Falahati, Ghazal Mousavi, Mohsen Alambardar Meybodi, Somayeh Sadat Mehrnia, Ilker Hacihaliloglu, Arman Rahmim, Mohammad R. Salmanpour
2025 J jnl
npj Digit. Medicine
Rohit Singla, Nikola Pupic, Seyed-Aryan Ghaffarizadeh, Caroline Kim, Ricky Hu, Bruce B. Forster, Ilker Hacihaliloglu
2025 conf
MICCAI (1)
Afshin Bozorgpour, Sina Ghorbani Kolahi, Reza Azad, Ilker Hacihaliloglu, Dorit Merhof
2025 J jnl
CoRR
Afshin Bozorgpour, Sina Ghorbani Kolahi, Reza Azad, Ilker Hacihaliloglu, Dorit Merhof
2025 J jnl
CoRR
Moein Heidari, Mohammad Amin Roohi, Ilker Hacihaliloglu
2025 J jnl
CoRR
Moein Heidari, Afshin Bozorgpour, AmirHossein Zarif-Fakharnia, Dorit Merhof, Ilker Hacihaliloglu
2025 J jnl
CoRR
Sajad Amiri, Shahram Taeb, Sara Gharibi, Setareh Dehghanfard, Somayeh Sadat Mehrnia, Mehrdad Oveisi, Ilker Hacihaliloglu, Arman Rahmim, Mohammad R. Salmanpour
2025 conf
MICCAI (16)
Milad Yazdani, Yasamin Medghalchi, Pooria Ashrafian, Ilker Hacihaliloglu, Dena Shahriari
2025 J jnl
CoRR
Milad Yazdani, Yasamin Medghalchi, Pooria Ashrafian, Ilker Hacihaliloglu, Dena Shahriari
2025 J jnl
CoRR
Mohammad R. Salmanpour, Somayeh Sadat Mehrnia, Sajad Jabarzadeh Ghandilu, Zhino Safahi, Sonya Falahati, Shahram Taeb, Ghazal Mousavi, Mehdi Maghsoudi, Ahmad Shariftabrizi, Ilker Hacihaliloglu, Arman Rahmim
2025 J jnl
CoRR
Yuetong Yu, Ruiyang Ge, Ilker Hacihaliloglu, Alexander Rauscher, Roger Tam, Sophia Frangou
2025 Misc conf
ICASSP
Ali Mehrabian, Parsa Mojarad Adi, Moein Heidari, Ilker Hacihaliloglu
2025 J jnl
CoRR
Mohammad R. Salmanpour, Amin Mousavi, Yixi Xu, William B. Weeks, Ilker Hacihaliloglu
2025 J jnl
IEEE Access
Mohammad R. Salmanpour, Morteza Alizadeh, Ghazal Mousavi, Saba Sadeghi, Sajad Amiri, Mehrdad Oveisi, Arman Rahmim, Ilker Hacihaliloglu
2025 J jnl
CoRR
Alvin B. Kimbowa, Arjun Parmar, Maziar Badii, David Liu, Matthew Harkey, Ilker Hacihaliloglu
2025 J jnl
CoRR
Mohammad R. Salmanpour, Seyed Mohammad Piri, Somayeh Sadat Mehrnia, Ahmad Shariftabrizi, Masume Allahmoradi, Venkata SK. Manem, Arman Rahmim, Ilker Hacihaliloglu
2025 A* conf
CVPR
Yasamin Medghalchi, Moein Heidari, Clayton Allard, Leonid Sigal, Ilker Hacihaliloglu
2025 J jnl
CoRR
Arman Gorji, Nima Sanati, Amir Hossein Pouria, Somayeh Sadat Mehrnia, Ilker Hacihaliloglu, Arman Rahmim, Mohammad R. Salmanpour
2025 J jnl
CoRR
Mohammad R. Salmanpour, Amir Hossein Pouria, Sonia Falahati, Shahram Taeb, Somayeh Sadat Mehrnia, Mehdi Maghsudi, Ali Fathi Jouzdani, Mehrdad Oveisi, Ilker Hacihaliloglu, Arman Rahmim
2025 J jnl
CoRR
Moein Heidari, Yasamin Medghalchi, Mahdi Khoursha, Reza Rezaeian, Ilker Hacihaliloglu
2024 J jnl
CoRR
Mohammad R. Salmanpour, Sajad Amiri, Sara Gharibi, Ahmad Shariftabrizi, Yixi Xu, William B. Weeks, Arman Rahmim, Ilker Hacihaliloglu
2024 J jnl
CoRR
Moein Heidari, Sina Ghorbani Kolahi, Sanaz Karimijafarbigloo, Bobby Azad, Afshin Bozorgpour, Soheila Hatami, Reza Azad, Ali Diba, Ulas Bagci, Dorit Merhof, Ilker Hacihaliloglu
2024 J jnl
npj Digit. Medicine
Rohit Singla, Nikola Pupic, Seyed-Aryan Ghaffarizadeh, Caroline Kim, Ricky Hu, Bruce B. Forster, Ilker Hacihaliloglu
2024 conf
ASMUS@MICCAI
Mohammad R. Salmanpour, Amin Mousavi, Yixi Xu, William B. Weeks, Ilker Hacihaliloglu
2024 J jnl
CoRR
Moein Heidari, Reza Azad, Sina Ghorbani Kolahi, René Arimond, Leon Niggemeier, Alaa Sulaiman, Afshin Bozorgpour, Ehsan Khodapanah Aghdam, Amirhossein Kazerouni, Ilker Hacihaliloglu, Dorit Merhof
2024 J jnl
CoRR
Ali Mehrabian, Parsa Mojarad Adi, Moein Heidari, Ilker Hacihaliloglu
2024 J jnl
CoRR
Yasamin Medghalchi, Niloufar Zakariaei, Arman Rahmim, Ilker Hacihaliloglu
2024 A conf
BMVC
Sina Ghorbani Kolahi, Seyed Kamal Chaharsooghi, Toktam Khatibi, Afshin Bozorgpour, Reza Azad, Moein Heidari, Ilker Hacihaliloglu, Dorit Merhof
2024 J jnl
CoRR
Sina Ghorbani Kolahi, Seyed Kamal Chaharsooghi, Toktam Khatibi, Afshin Bozorgpour, Reza Azad, Moein Heidari, Ilker Hacihaliloglu, Dorit Merhof
2024 J jnl
CoRR
Mohammad R. Salmanpour, Morteza Alizadeh, Ghazal Mousavi, Saba Sadeghi, Sajad Amiri, Mehrdad Oveisi, Arman Rahmim, Ilker Hacihaliloglu
2024 J jnl
CoRR
Yasamin Medghalchi, Moein Heidari, Clayton Allard, Leonid Sigal, Ilker Hacihaliloglu
2024 J jnl
CoRR
Moein Heidari, Reza Rezaeian, Reza Azad, Dorit Merhof, Hamid Soltanian-Zadeh, Ilker Hacihaliloglu
2024 J jnl
CoRR
Pooria Ashrafian, Milad Yazdani, Moein Heidari, Dena Shahriari, Ilker Hacihaliloglu
2023 A* conf
CVPR
Aimon Rahman, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2023 J jnl
CoRR
Aimon Rahman, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2023 J jnl
Medical Image Anal.
Amirhossein Kazerouni, Ehsan Khodapanah Aghdam, Moein Heidari, Reza Azad, Mohsen Fayyaz, Ilker Hacihaliloglu, Dorit Merhof
2023 J jnl
CoRR
Xiao Qi, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2022 J jnl
CoRR
Amirhossein Kazerouni, Ehsan Khodapanah Aghdam, Moein Heidari, Reza Azad, Mohsen Fayyaz, Ilker Hacihaliloglu, Dorit Merhof
2022 J jnl
IEEE Trans. Medical Imaging
Jeya Maria Jose Valanarasu, Vishwanath A. Sindagi, Ilker Hacihaliloglu, Vishal M. Patel
2022 conf
MILLanD@MICCAI
Xiao Qi, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2022 J jnl
CoRR
Xiao Qi, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2022 conf
MICCAI (5)
Aimon Rahman, Wele Gedara Chaminda Bandara, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2022 J jnl
CoRR
Aimon Rahman, Wele Gedara Chaminda Bandara, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2022 conf
MICCAI (4)
Aimon Rahman, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2022 J jnl
CoRR
Aimon Rahman, Jeya Maria Jose Valanarasu, Ilker Hacihaliloglu, Vishal M. Patel
2021 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Xiao Qi, Lloyd G. Brown, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2021 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Hui Che, Lloyd G. Brown, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2021 conf
MICCAI (1)
Jeya Maria Jose Valanarasu, Poojan Oza, Ilker Hacihaliloglu, Vishal M. Patel
2021 J jnl
CoRR
Jeya Maria Jose Valanarasu, Poojan Oza, Ilker Hacihaliloglu, Vishal M. Patel
2021 conf
MLMI@MICCAI
Xiao Qi, David J. Foran, John L. Nosher, Ilker Hacihaliloglu
2021 conf
EMBC
Hui Che, Jared Radbel, Jag Sunderram, John L. Nosher, Vishal M. Patel, Ilker Hacihaliloglu
2021 conf
ASMUS@MICCAI
Hui Che, Sumana Ramanathan, David J. Foran, John L. Nosher, Vishal M. Patel, Ilker Hacihaliloglu
2021 J jnl
CoRR
Hui Che, Sumana Ramanathan, David J. Foran, John L. Nosher, Vishal M. Patel, Ilker Hacihaliloglu
2021 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Cosmas Mwikirize, Alvin B. Kimbowa, Sylvia Imanirakiza, Andrew Katumba, John L. Nosher, Ilker Hacihaliloglu
2020 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Ahmed Z. Alsinan, Vishal M. Patel, Ilker Hacihaliloglu
2020 J jnl
CoRR
Xiao Qi, Lloyd G. Brown, David J. Foran, Ilker Hacihaliloglu
2020 conf
MICCAI (6)
Ahmed Z. Alsinan, Charles Rule, Michael Vives, Vishal M. Patel, Ilker Hacihaliloglu
2020 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Stamatia Giannarou, Ilker Hacihaliloglu
2020 C conf
BIBE
Hridayi Patel, Ilker Hacihaliloglu
2020 J jnl
CoRR
Jeya Maria Jose Valanarasu, Vishwanath A. Sindagi, Ilker Hacihaliloglu, Vishal M. Patel
2020 conf
MICCAI (4)
Jeya Maria Jose Valanarasu, Vishwanath A. Sindagi, Ilker Hacihaliloglu, Vishal M. Patel
2020 J jnl
CoRR
V. Jeya Maria Jose, Vishwanath Sindagi, Ilker Hacihaliloglu, Vishal M. Patel
2020 J jnl
IEEE J. Sel. Top. Signal Process.
Jeya Maria Jose Valanarasu, Rajeev Yasarla, Puyang Wang, Ilker Hacihaliloglu, Vishal M. Patel
2020 conf
MICCAI (6)
Puyang Wang, Michael Vives, Vishal M. Patel, Ilker Hacihaliloglu
2020 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Puyang Wang, Michael Vives, Vishal M. Patel, Ilker Hacihaliloglu
2019 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Ahmed Z. Alsinan, Vishal M. Patel, Ilker Hacihaliloglu
2019 J jnl
J. Imaging
Prajna Ramesh Desai, Ilker Hacihaliloglu
2019 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2019 J jnl
CoRR
V. Jeya Maria Jose, Rajeev Yasarla, Puyang Wang, Ilker Hacihaliloglu, Vishal M. Patel
2019 conf
MICCAI (5)
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2018 conf
MICCAI (2)
Jian Ren, Ilker Hacihaliloglu, Eric A. Singer, David J. Foran, Xin Qi
2018 J jnl
CoRR
Jian Ren, Ilker Hacihaliloglu, Eric A. Singer, David J. Foran, Xin Qi
2018 conf
ISBI
Puyang Wang, Nick G. Cuccolo, Rachana Tyagi, Ilker Hacihaliloglu, Vishal M. Patel
2018 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2018 conf
ISBI
Prajna Ramesh Desai, Ilker Hacihaliloglu
2018 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2018 conf
MICCAI (4)
Puyang Wang, Vishal M. Patel, Ilker Hacihaliloglu
2018 J jnl
CoRR
Puyang Wang, Vishal M. Patel, Ilker Hacihaliloglu
2017 conf
Image-Guided Procedures
Soheil Ghafurian, Ilker Hacihaliloglu, Dimitris N. Metaxas, Virak Tan, Kang Li
2017 J jnl
Neurocomputing
Soheil Ghafurian, Ilker Hacihaliloglu, Dimitris N. Metaxas, Virak Tan, Kang Li
2017 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Ilker Hacihaliloglu
2017 conf
CARE/CLIP@MICCAI
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2017 conf
MSKI@MICCAI
Ilker Hacihaliloglu
2016 conf
MICCAI (1)
Cosmas Mwikirize, John L. Nosher, Ilker Hacihaliloglu
2016 conf
Computer-Aided Diagnosis
Mikhiel Lim, Ilker Hacihaliloglu
2015 conf
Image-Guided Procedures
Soheil Ghafurian, Ilker Hacihaliloglu, Dimitris N. Metaxas, Virak Tan, Kang Li
2015 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Simrin Nagpal, Purang Abolmaesumi, Abtin Rasoulian, Ilker Hacihaliloglu, Tamas Ungi, Jill Osborn, Victoria A. Lessoway, John F. Rudan, Melanie Jaeger, Robert N. Rohling, Dan P. Borschneck, Parvin Mousavi
2015 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Ilker Hacihaliloglu, Pierre Guy, Antony J. Hodgson, Rafeef Abugharbieh
2015 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Emran Mohammad Abu Anas, Alexander Seitel, Abtin Rasoulian, Paul St. John, David R. Pichora, Kathryn Darras, David R. Wilson, Victoria A. Lessoway, Ilker Hacihaliloglu, Parvin Mousavi, Robert Rohling, Purang Abolmaesumi
2015 conf
MICCAI (1)
Ilker Hacihaliloglu, Parmida Beigi, Gary C. Ng, Robert N. Rohling, Septimiu E. Salcudean, Purang Abolmaesumi
2015 conf
Image-Guided Procedures
Emran Mohammad Abu Anas, Abtin Rasoulian, Paul St. John, David R. Pichora, Parvin Mousavi, Victoria A. Lessoway, Alexander Seitel, Ilker Hacihaliloglu, Robert Rohling, Purang Abolmaesumi
2014 conf
Image-Guided Procedures
Simrin Nagpal, Ilker Hacihaliloglu, Tamas Ungi, Abtin Rasoulian, Jill Osborn, Victoria A. Lessoway, Robert N. Rohling, Daniel P. Borschneck, Purang Abolmaesumi, Parvin Mousavi
2014 conf
IPCAI
Simrin Nagpal, Purang Abolmaesumi, Abtin Rasoulian, Tamas Ungi, Ilker Hacihaliloglu, Jill Osborn, Dan P. Borschneck, Victoria A. Lessoway, Robert Rohling, Parvin Mousavi
2014 J jnl
IEEE Trans. Medical Imaging
Ilker Hacihaliloglu, Abtin Rasoulian, Robert Rohling, Purang Abolmaesumi
2013 J jnl
Int. J. Comput. Assist. Radiol. Surg.
Ilker Hacihaliloglu, David R. Wilson, Michael Gilbart, Michael A. Hunt, Purang Abolmaesumi
2013 conf
MICCAI (2)
Ilker Hacihaliloglu, Abtin Rasoulian, Robert Rohling, Purang Abolmaesumi
2012 conf
MICCAI (2)
Ilker Hacihaliloglu, Anna Brounstein, Pierre Guy, Antony J. Hodgson, Rafeef Abugharbieh
2012 conf
IPCAI
Ilker Hacihaliloglu, David R. Wilson, Michael Gilbart, Michael A. Hunt, Purang Abolmaesumi
2011 conf
MICCAI (1)
Anna Brounstein, Ilker Hacihaliloglu, Pierre Guy, Antony J. Hodgson, Rafeef Abugharbieh
2010 B conf
Image Processing
Rupin Dalvi, Ilker Hacihaliloglu, Rafeef Abugharbieh
2009 conf
ISVC (1)
Ilker Hacihaliloglu, Rafeef Abugharbieh, Antony J. Hodgson, Robert Rohling
2008 conf
MICCAI (1)
Ilker Hacihaliloglu, Rafeef Abugharbieh, Antony J. Hodgson, Robert Rohling
tests/integration/test_base_extractor.py
← Index tests/integration/test_base_extractor.py python
"""
Integration tests for the base Extractor class.
"""
import pytest
import hashlib
import math
from unittest.mock import Mock, patch, MagicMock
from collections import Counter

pytestmark = [pytest.mark.integration]


class TestExtractorStaticMethods:
    """Tests for static methods in Extractor class."""

    def test_process_binary_string_printable(self):
        """Test processing a printable binary string."""
        from redb.extractors.extractor import Extractor

        # Test with printable ASCII characters
        input_bytes = b"Hello World\x00\x00\x00"
        result = Extractor.process_binary_string(input_bytes)
        assert result == "Hello World"

    def test_process_binary_string_non_printable(self):
        """Test processing a string with non-printable characters."""
        from redb.extractors.extractor import Extractor

        # Test with non-printable characters
        input_bytes = b"\x01\x02Hello\x00"
        result = Extractor.process_binary_string(input_bytes)
        assert "\\x01" in result
        assert "\\x02" in result
        assert "Hello" in result

    def test_process_binary_string_empty(self):
        """Test processing an empty binary string."""
        from redb.extractors.extractor import Extractor

        input_bytes = b"\x00\x00\x00"
        result = Extractor.process_binary_string(input_bytes)
        assert result == ""

    def test_process_binary_string_all_printable(self):
        """Test processing a fully printable string."""
        from redb.extractors.extractor import Extractor

        input_bytes = b"TestString123"
        result = Extractor.process_binary_string(input_bytes)
        assert result == "TestString123"

    def test_remove_non_utf8_valid(self):
        """Test removing non-UTF8 characters from valid UTF8 string."""
        from redb.extractors.extractor import Extractor

        input_bytes = b"Hello World"
        result = Extractor.remove_non_utf8(input_bytes)
        assert result == b"Hello World"

    def test_remove_non_utf8_with_invalid(self):
        """Test removing non-UTF8 characters from mixed string."""
        from redb.extractors.extractor import Extractor

        # Mix of valid UTF8 and invalid bytes
        input_bytes = b"Hello\xff\xfeWorld"
        result = Extractor.remove_non_utf8(input_bytes)
        # Should remove the invalid bytes
        assert b"\xff" not in result
        assert b"\xfe" not in result
        assert b"Hello" in result
        assert b"World" in result

    def test_remove_non_utf8_empty(self):
        """Test removing non-UTF8 from empty string."""
        from redb.extractors.extractor import Extractor

        result = Extractor.remove_non_utf8(b"")
        assert result == b""


class TestExtractorEntropyCalculation:
    """Tests for entropy calculation in Extractor class."""

    def test_calculate_entropy_empty_data(self, elf_binary_path, mock_logger):
        """Test entropy calculation with empty data."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            result = extractor.calculate_entropy(b"")
            assert result == 0.0

    def test_calculate_entropy_uniform_data(self, elf_binary_path, mock_logger):
        """Test entropy calculation with uniform (low entropy) data."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            # All same bytes = 0 entropy
            uniform_data = b"\x00" * 256
            result = extractor.calculate_entropy(uniform_data)
            assert result == 0.0

    def test_calculate_entropy_random_data(self, elf_binary_path, mock_logger, high_entropy_data):
        """Test entropy calculation with random (high entropy) data."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            result = extractor.calculate_entropy(high_entropy_data)
            # Random data should have entropy close to 8 (max for bytes)
            assert result > 7.0

    def test_calculate_entropy_binary_data(self, elf_binary_path, mock_logger):
        """Test entropy calculation with binary data."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            # Two equally distributed values = 1 bit entropy
            binary_data = b"\x00\x01" * 128
            result = extractor.calculate_entropy(binary_data)
            assert abs(result - 1.0) < 0.01

    def test_calculate_entropy_string_data(self, elf_binary_path, mock_logger):
        """Test entropy calculation with string data."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            # String with two equally distributed characters
            string_data = "ab" * 100
            result = extractor.calculate_entropy(string_data)
            assert abs(result - 1.0) < 0.01


class TestExtractorInitialization:
    """Tests for Extractor initialization."""

    def test_extractor_hashes_computed_on_init(self, elf_binary_path, mock_logger, known_hashes):
        """Test that hashes are computed during initialization."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)

            assert extractor.md5 == known_hashes['md5']
            assert extractor.sha1 == known_hashes['sha1']
            assert extractor.sha256 == known_hashes['sha256']

    def test_extractor_hash_dataclass_created(self, elf_binary_path, mock_logger, known_hashes):
        """Test that Hash dataclass is created during initialization."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)

            assert extractor.hash.md5 == known_hashes['md5']
            assert extractor.hash.sha1 == known_hashes['sha1']
            assert extractor.hash.sha256 == known_hashes['sha256']

    def test_extractor_binary_cached_property(self, elf_binary_path, mock_logger, elf_binary_content):
        """Test that binary content is loaded as cached property."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)

            # Access binary property
            binary = extractor.binary
            assert binary == elf_binary_content

            # Second access should return cached value (same id)
            assert extractor.binary is binary

    def test_extractor_with_exporters(self, elf_binary_path, mock_logger, mock_print_exporter):
        """Test extractor initialization with exporters."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                exporters=[mock_print_exporter]
            )

            assert len(extractor.exporters) == 1
            assert extractor.exporters[0] is mock_print_exporter

    def test_extractor_with_index_prefix(self, elf_binary_path, mock_logger):
        """Test extractor initialization with custom index prefix."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                index_prefix="custom_prefix"
            )

            assert "custom_prefix" in extractor.elastic_index

    def test_extractor_known_benign_flag(self, elf_binary_path, mock_logger):
        """Test extractor with known_benign flag."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                known_benign=True
            )

            assert extractor.known_benign is True
            assert extractor.known_malicious is False

    def test_extractor_known_malicious_flag(self, elf_binary_path, mock_logger):
        """Test extractor with known_malicious flag."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                known_malicious=True
            )

            assert extractor.known_benign is False
            assert extractor.known_malicious is True


class TestExtractorExportData:
    """Tests for export_data method."""

    def test_export_data_with_print_exporter(self, elf_binary_path, mock_logger, mock_print_exporter, capsys):
        """Test export_data with PrintExporter."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                exporters=[mock_print_exporter]
            )

            result = extractor.export_data()
            # Should succeed with PrintExporter
            assert result is True

    def test_export_data_no_exporters(self, elf_binary_path, mock_logger):
        """Test export_data with no exporters configured."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(
                elf_binary_path,
                mock_logger,
                exporters=[]
            )

            result = extractor.export_data()
            # Should succeed with no exporters (nothing to export)
            assert result is True


class TestExtractorEdgeCases:
    """Tests for edge cases in Extractor class."""

    def test_extractor_with_nonexistent_file(self, mock_logger):
        """Test extractor with non-existent file."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            with pytest.raises(FileNotFoundError):
                BasicPropertiesExtractor("/nonexistent/file.bin", mock_logger)

    def test_entropy_none_data(self, elf_binary_path, mock_logger):
        """Test entropy calculation with None returns 0."""
        from redb.extractors.basicproperties import BasicPropertiesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = BasicPropertiesExtractor(elf_binary_path, mock_logger)
            result = extractor.calculate_entropy(None)
            assert result == 0.0

    def test_process_binary_string_high_bytes(self):
        """Test processing binary string with high byte values."""
        from redb.extractors.extractor import Extractor

        # Characters above 126 are non-printable
        input_bytes = b"\x7f\x80\x81\xff"
        result = Extractor.process_binary_string(input_bytes)
        assert "\\x7f" in result
        assert "\\x80" in result
        assert "\\xff" in result