simulariumio/mcell/mcell_converter.py
def _read_cellblender_data(
        timestep: float,
        molecule_list: Dict[str, Any],
        input_data: McellData,
    ) -> AgentData:
        """
        Parse cellblender binary files to get spatial data
        """
        dimensions = McellConverter._get_dimensions_of_cellblender_data(
            input_data.path_to_binary_files, input_data.nth_timestep_to_read
        )
        result = AgentData.from_dimensions(dimensions)
        # get metadata for each agent type
        molecule_info = {}
        total_steps = 0
        for molecule in molecule_list:
            molecule_info[molecule["mol_name"]] = molecule
        for file_name in os.listdir(input_data.path_to_binary_files):
            if not McellConverter._should_read_cellblender_binary_file(
                file_name, input_data.nth_timestep_to_read
            ):
                continue
            split_file_name = file_name.split(".")
            time_index = int(split_file_name[split_file_name.index("dat") - 1])
            if time_index > total_steps:
                total_steps = time_index
            result.times[time_index] = time_index * timestep
            result = McellConverter._read_binary_cellblender_viz_frame(
                os.path.join(input_data.path_to_binary_files, file_name),
                time_index,
                molecule_info,
                input_data,
                result,
            )
        result.n_timesteps = total_steps + 1
        return result

        Parse cellblender binary files to get spatial data
        
Parse cellblender binary files to get spatial data
Parse cellblender binary files to get spatial data
def _read_cellblender_data(
        timestep: float,
        molecule_list: Dict[str, Any],
        input_data: McellData,
    ) -> AgentData:
        dimensions = McellConverter._get_dimensions_of_cellblender_data(
            input_data.path_to_binary_files, input_data.nth_timestep_to_read
        )
        result = AgentData.from_dimensions(dimensions)
        molecule_info = {}
        total_steps = 0
        for molecule in molecule_list:
            molecule_info[molecule["mol_name"]] = molecule
        for file_name in os.listdir(input_data.path_to_binary_files):
            if not McellConverter._should_read_cellblender_binary_file(
                file_name, input_data.nth_timestep_to_read
            ):
                continue
            split_file_name = file_name.split(".")
            time_index = int(split_file_name[split_file_name.index("dat") - 1])
            if time_index > total_steps:
                total_steps = time_index
            result.times[time_index] = time_index * timestep
            result = McellConverter._read_binary_cellblender_viz_frame(
                os.path.join(input_data.path_to_binary_files, file_name),
                time_index,
                molecule_info,
                input_data,
                result,
            )
        result.n_timesteps = total_steps + 1
        return result
def _read_cellblender_data ( timestep : float , molecule_list : Dict [ str , Any ] , input_data : McellData , ) -> AgentData : dimensions = McellConverter . _get_dimensions_of_cellblender_data ( input_data . path_to_binary_files , input_data . nth_timestep_to_read ) result = AgentData . from_dimensions ( dimensions ) molecule_info = { } total_steps = 0 for molecule in molecule_list : molecule_info [ molecule [ "mol_name" ] ] = molecule for file_name in os . listdir ( input_data . path_to_binary_files ) : if not McellConverter . _should_read_cellblender_binary_file ( file_name , input_data . nth_timestep_to_read ) : continue split_file_name = file_name . split ( "." ) time_index = int ( split_file_name [ split_file_name . index ( "dat" ) - 1 ] ) if time_index > total_steps : total_steps = time_index result . times [ time_index ] = time_index * timestep result = McellConverter . _read_binary_cellblender_viz_frame ( os . path . join ( input_data . path_to_binary_files , file_name ) , time_index , molecule_info , input_data , result , ) result . n_timesteps = total_steps + 1 return result
Parse cellblender binary files to get spatial data
Parse cellblender binary files to get spatial data
"""
        Parse cellblender binary files to get spatial data
        """ # get metadata for each agent type
timestep
float
molecule_list
Dict[str, Any]
input_data
McellData