Katherine L. Narr

39 papers A* 1Journal 26Unranked 12
YearRankTypeTitle / Venue / Authors
2022 J jnl
NeuroImage
Amber M. Leaver, Sara Gonzalez, Megha Vasavada, Antoni Kubicki, Mayank A. Jog, Danny J. J. Wang, Roger P. Woods, Randall Espinoza, Jacqueline Gollan, Todd B. Parrish, Katherine L. Narr
2022 conf
GeoMedIA
Andrew Lizarraga, Katherine L. Narr, Kirsten A. Donald, Shantanu H. Joshi
2022 J jnl
CoRR
Andrew Lizarraga, Katherine L. Narr, Kristy A. Donald, Shantanu H. Joshi
2021 conf
CDMRI@MICCAI
Andrew Lizarraga, David S. Lee, Antoni Kubicki, Ashish Sahib, Elvis Nunez, Katherine L. Narr, Shantanu H. Joshi
2021 J jnl
CoRR
Andrew Lizarraga, David S. Lee, Antoni Kubicki, Ashish Sahib, Elvis Nunez, Katherine L. Narr, Shantanu H. Joshi
2021 J jnl
NeuroImage
Leonardo Tozzi, Esther T. Anene, Ian H. Gotlib, Max Wintermark, Adam B. Kerr, Hua Wu, Darsol Seok, Katherine L. Narr, Yvette I. Sheline, Susan L. Whitfield-Gabrieli, Leanne M. Williams
2020 conf
ISBI
David S. Lee, Kirsten A. Donald, Taykhoom Dalal, Catherine J. Wedderburn, Annerine Roos, Jonathan Ipser, Sivenesi Subramoney, Heather J. Zar, Dan J. Stein, Katherine L. Narr, Gerhard Hellemann, Roger P. Woods, Shantanu H. Joshi
2020 conf
MICCAI (7)
David S. Lee, Ashish Sahib, Katherine L. Narr, Elvis Nunez, Shantanu H. Joshi
2020 J jnl
NeuroImage
Catherine J. Wedderburn, Sivenesi Subramoney, Shunmay Yeung, Jean-Paul Fouche, Shantanu H. Joshi, Katherine L. Narr, Andrea M. Rehman, Annerine Roos, Jonathan Ipser, Frances C. Robertson, Nynke A. Groenewold, Diana M. Gibb, Heather J. Zar, Dan J. Stein, Kirsten A. Donald
2019 conf
MICCAI (2)
David S. Lee, Ashish Sahib, Benjamin S. C. Wade, Katherine L. Narr, Gerhard Hellemann, Roger P. Woods, Shantanu H. Joshi
2018 conf
MICCAI (3)
David S. Lee, Joana R. Loureiro, Katherine L. Narr, Roger P. Woods, Shantanu H. Joshi
2017 conf
CVPR Workshops
Susovan Pal, Roger P. Woods, Suchit Panjiyar, Elizabeth R. Sowell, Katherine L. Narr, Shantanu H. Joshi
2017 conf
ISBI
Benjamin S. C. Wade, Jing Sui, Stephanie Njau, Amber M. Leaver, Megha Vasvada, Boris A. Gutman, Paul M. Thompson, Randall Espinoza, Roger P. Woods, Christopher C. Abbott, Katherine L. Narr, Shantanu H. Joshi
2017 conf
CNI@MICCAI
David S. Lee, Amber M. Leaver, Katherine L. Narr, Roger P. Woods, Shantanu H. Joshi
2015 conf
ISBI
Shantanu H. Joshi, Antonio Marquina, Stephanie Njau, Katherine L. Narr, Roger P. Woods
2015 conf
ISBI
Benjamin S. C. Wade, Shantanu H. Joshi, Tara Pirnia, Amber M. Leaver, Roger P. Woods, Paul M. Thompson, Randall Espinoza, Katherine L. Narr
2013 J jnl
NeuroImage
Shantanu H. Joshi, Katherine L. Narr, Owen R. Phillips, Keith H. Nuechterlein, Robert F. Asarnow, Arthur W. Toga, Roger P. Woods
2013 J jnl
Brain Connect.
Owen R. Phillips, Kristi Clark, Eileen Luders, Ramin Azhir, Shantanu H. Joshi, Roger P. Woods, John C. Mazziotta, Arthur W. Toga, Katherine L. Narr
2012 J jnl
NeuroImage
Eileen Luders, Owen R. Phillips, Kristi Clark, Florian Kurth, Arthur W. Toga, Katherine L. Narr
2012 J jnl
IEEE Trans. Medical Imaging
Shantanu H. Joshi, Ryan P. Cabeen, Anand A. Joshi, Bo Sun, Ivo D. Dinov, Katherine L. Narr, Arthur W. Toga, Roger P. Woods
2011 J jnl
NeuroImage
Eileen Luders, Kristi Clark, Katherine L. Narr, Arthur W. Toga
2011 J jnl
NeuroImage
Eileen Luders, Paul M. Thompson, Katherine L. Narr, Alen Zamanyan, Yi-Yu Chou, Boris Gutman, Ivo D. Dinov, Arthur W. Toga
2010 A* conf
CVPR
Shantanu H. Joshi, Ryan P. Cabeen, Anand A. Joshi, Roger P. Woods, Katherine L. Narr, Arthur W. Toga
2009 J jnl
IEEE Trans. Medical Imaging
Nathan S. Hageman, Arthur W. Toga, Katherine L. Narr, David W. Shattuck
2009 J jnl
NeuroImage
Carsten Konrad, T. Ukas, C. Nebel, Volker Arolt, Arthur W. Toga, Katherine L. Narr
2009 J jnl
NeuroImage
David W. Shattuck, Gautam Prasad, Mubeena Mirza, Katherine L. Narr, Arthur W. Toga
2009 J jnl
NeuroImage
Eileen Luders, Francisco J. Sánchez, Christian Gaser, Arthur W. Toga, Katherine L. Narr, Liberty S. Hamilton, Eric Vilain
2008 J jnl
IEEE Trans. Medical Imaging
Zhuowen Tu, Katherine L. Narr, Piotr Dollár, Ivo D. Dinov, Paul M. Thompson, Arthur W. Toga
2008 J jnl
NeuroImage
David W. Shattuck, Mubeena Mirza, Vitria Adisetiyo, Cornelius Hojatkashani, Georges Salamon, Katherine L. Narr, Russell A. Poldrack, Robert M. Bilder, Arthur W. Toga
2008 J jnl
NeuroImage
David E. Rex, David W. Shattuck, Roger P. Woods, Katherine L. Narr, Eileen Luders, Kelly Rehm, Sarah E. Stoltzner, David A. Rottenberg, Arthur W. Toga
2007 J jnl
NeuroImage
Katherine L. Narr, Robert M. Bilder, Eileen Luders, Paul M. Thompson, Roger P. Woods, Delbert Robinson, Philip R. Szeszko, Teodora Dimtcheva, Suresh Gurbani, Arthur W. Toga
2007 J jnl
NeuroImage
Eileen Luders, Katherine L. Narr, Robert M. Bilder, Paul M. Thompson, Philip R. Szeszko, Liberty S. Hamilton, Arthur W. Toga
2006 J jnl
NeuroImage
Eileen Luders, Paul M. Thompson, Katherine L. Narr, Arthur W. Toga, Lutz Jäncke, Christian Gaser
2006 conf
ISBI
Nathan S. Hageman, David W. Shattuck, Katherine L. Narr, Arthur W. Toga
2005 J jnl
NeuroImage
Eileen Luders, Katherine L. Narr, Paul M. Thompson, Roger P. Woods, David E. Rex, Lutz Jäncke, Helmuth Steinmetz, Arthur W. Toga
2004 J jnl
NeuroImage
David E. Rex, David W. Shattuck, Roger P. Woods, Katherine L. Narr, Eileen Luders, Kelly Rehm, Sarah E. Stoltzner, David A. Rottenberg, Arthur W. Toga
2004 J jnl
NeuroImage
Martina Ballmaier, John T. O'Brien, Emma J. Burton, Paul M. Thompson, David E. Rex, Katherine L. Narr, Ian G. McKeith, Heather DeLuca, Arthur W. Toga
2004 J jnl
NeuroImage
Katherine L. Narr, Paul M. Thompson, Philip R. Szeszko, Delbert Robinson, Seon-Ah Jang, Roger P. Woods, Sharon Kim, Kiralee M. Hayashi, Dina Asunction, Arthur W. Toga, Robert M. Bilder
2001 J jnl
J. Am. Medical Informatics Assoc.
John C. Mazziotta, Arthur W. Toga, Alan C. Evans, Peter T. Fox, Jack L. Lancaster, Karl Zilles, Roger P. Woods, Tomás Paus, Gregory Simpson, G. Bruce Pike, Colin J. Holmes, D. Louis Collins, Paul M. Thompson, David MacDonald, Marco Iacoboni, Thorsten Schormann, Katrin Amunts, Nicola Palomero-Gallagher, Stefan Geyer, Larry Parsons, Katherine L. Narr, Noor Kabani, Georges Le Goualher, Jordan Feidler, Kenneth P. Smith, Dorret I. Boomsma, Hilleke E. Hulshoff Pol, Tyrone D. Cannon, Ryuta Kawashima, Bernard Mazoyer
redb/s3_utils.py
← Index redb/s3_utils.py python
"""
S3 and file utility functions for REDB.

Contains MinIO/S3 client creation, S3 key generation,
file download, and archive extraction helpers.
"""
import os
import tempfile
from typing import Optional, List

from minio import Minio
from minio.error import S3Error


def get_minio_client():
    """Create and return a Minio client using credentials from .env file"""
    return Minio(
        endpoint=os.getenv("S3_ENDPOINT"),
        access_key=os.getenv("S3_ACCESS_KEY"),
        secret_key=os.getenv("S3_SECRET_KEY"),
        secure=os.getenv("S3_SECURE", "false").lower() == "true"
    )


def generate_s3_key_from_hash(sample_hash: str) -> str:
    """
    Generate S3 key from hash using sharding structure.
    Example: 09f7d02a3c2382199458c98a62b045145ee54ab6aba86166aecf3d10c3c1444c
    becomes: 09/f7/09f7d02a3c2382199458c98a62b045145ee54ab6aba86166aecf3d10c3c1444c.zip
    """
    if len(sample_hash) < 4:
        raise ValueError(f"Hash too short for sharding: {sample_hash}")

    # Create sharded path: first 2 chars / next 2 chars / full_hash.zip
    return f"{sample_hash[:2]}/{sample_hash[2:4]}/{sample_hash}.zip"


def download_s3_object(s3_bucket: str, s3_key: str, temp_dir: str, logger=None) -> Optional[str]:
    """
    Download an object from S3 to a local temporary directory and return the local path.
    If the .zip file is not found, automatically tries .7z as a fallback for legacy uploads.
    """
    try:
        minio_client = get_minio_client()
        local_path = os.path.join(temp_dir, os.path.basename(s3_key))

        # Download the file
        minio_client.fget_object(s3_bucket, s3_key, local_path)

        return local_path
    except S3Error as e:
        # If .zip not found and error is NoSuchKey, try .7z fallback
        if e.code == 'NoSuchKey' and s3_key.endswith('.zip'):
            s3_key_7z = s3_key[:-4] + '.7z'  # Replace .zip with .7z
            if logger:
                logger.info(f".zip not found, trying .7z fallback: {s3_key_7z}")
            try:
                local_path_7z = os.path.join(temp_dir, os.path.basename(s3_key_7z))
                minio_client.fget_object(s3_bucket, s3_key_7z, local_path_7z)
                if logger:
                    logger.info(f"Successfully downloaded .7z fallback: {s3_key_7z}")
                return local_path_7z
            except S3Error as e2:
                if logger:
                    logger.error(f"Failed to download S3 object {s3_key} (tried both .zip and .7z): {e2}")
                else:
                    print(f"[ERROR] Failed to download S3 object {s3_key} (tried both .zip and .7z): {e2}")
                return None
        else:
            if logger:
                logger.error(f"Failed to download S3 object {s3_key}: {e}")
            else:
                print(f"[ERROR] Failed to download S3 object {s3_key}: {e}")
            return None


def extract_fat_slices(macho, output_dir: str, logger) -> List[tuple]:
    """
    Extract slices from FAT Mach-O binary using machofile's dump_slices() API.

    Args:
        macho: Parsed machofile.UniversalMachO object
        output_dir: Directory to write slice files
        logger: Logger instance

    Returns:
        List of (arch_name, slice_path, slice_sha256, slice_md5, slice_sha1) tuples
    """
    result = []
    try:
        # Use machofile's dump_slices API (v2026.2.5+)
        slices = macho.dump_slices(output_dir=output_dir)
        logger.debug(f"Extracted {len(slices)} slices from FAT binary")

        for arch_name, slice_path in slices:
            # Get hash info for this slice from machofile
            general_info = macho.get_general_info(arch=arch_name)
            slice_sha256 = general_info.get('SHA256')
            slice_md5 = general_info.get('MD5')
            slice_sha1 = general_info.get('SHA1')
            result.append((arch_name, slice_path, slice_sha256, slice_md5, slice_sha1))
            logger.debug(f"Slice {arch_name}: {slice_sha256}")

    except Exception as e:
        logger.error(f"Error extracting FAT slices: {e}")

    return result