simulariumio/cytosim/cytosim_converter.py
def _read(input_data: CytosimData) -> TrajectoryData:
        """
        Return a TrajectoryData object containing the CytoSim data
        """
        print("Reading Cytosim Data -------------")
        # load the data from Cytosim output .txt files
        cytosim_data = {}
        for object_type in input_data.object_info:
            cytosim_data[object_type] = (
                input_data.object_info[object_type]
                .cytosim_file.get_contents()
                .split("\n")
            )
        # parse
        dimensions = CytosimConverter._parse_dimensions(cytosim_data)
        agent_data = AgentData.from_dimensions(dimensions)
        agent_data.draw_fiber_points = input_data.draw_fiber_points
        uids = []
        for object_type in input_data.object_info:
            agent_data, uids = CytosimConverter._parse_objects(
                object_type,
                cytosim_data[object_type],
                input_data.meta_data.scale_factor,
                input_data.object_info[object_type],
                agent_data,
                uids,
            )
        # get display data (geometry and color)
        for object_type in input_data.object_info:
            for tid in input_data.object_info[object_type].display_data:
                display_data = input_data.object_info[object_type].display_data[tid]
                if "fiber" in object_type and (
                    display_data.display_type != DISPLAY_TYPE.NONE
                    and display_data.display_type != DISPLAY_TYPE.FIBER
                ):
                    display_data.display_type = DISPLAY_TYPE.FIBER
                    print(
                        f"{display_data.name} display type of "
                        f"{display_data.display_type.value} was changed to FIBER"
                    )
                agent_data.display_data[display_data.name] = display_data
        # create TrajectoryData
        input_data.meta_data._set_box_size()
        return TrajectoryData(
            meta_data=input_data.meta_data,
            agent_data=agent_data,
            time_units=UnitData("s"),
            spatial_units=UnitData("µm", 1.0 / input_data.meta_data.scale_factor),
            plots=input_data.plots,
        )

        Return a TrajectoryData object containing the CytoSim data
        
Return a TrajectoryData object containing the CytoSim data
Return a TrajectoryData object containing the CytoSim data
def _read(input_data: CytosimData) -> TrajectoryData:
        print("Reading Cytosim Data -------------")
        cytosim_data = {}
        for object_type in input_data.object_info:
            cytosim_data[object_type] = (
                input_data.object_info[object_type]
                .cytosim_file.get_contents()
                .split("\n")
            )
        dimensions = CytosimConverter._parse_dimensions(cytosim_data)
        agent_data = AgentData.from_dimensions(dimensions)
        agent_data.draw_fiber_points = input_data.draw_fiber_points
        uids = []
        for object_type in input_data.object_info:
            agent_data, uids = CytosimConverter._parse_objects(
                object_type,
                cytosim_data[object_type],
                input_data.meta_data.scale_factor,
                input_data.object_info[object_type],
                agent_data,
                uids,
            )
        for object_type in input_data.object_info:
            for tid in input_data.object_info[object_type].display_data:
                display_data = input_data.object_info[object_type].display_data[tid]
                if "fiber" in object_type and (
                    display_data.display_type != DISPLAY_TYPE.NONE
                    and display_data.display_type != DISPLAY_TYPE.FIBER
                ):
                    display_data.display_type = DISPLAY_TYPE.FIBER
                    print(
                        f"{display_data.name} display type of "
                        f"{display_data.display_type.value} was changed to FIBER"
                    )
                agent_data.display_data[display_data.name] = display_data
        input_data.meta_data._set_box_size()
        return TrajectoryData(
            meta_data=input_data.meta_data,
            agent_data=agent_data,
            time_units=UnitData("s"),
            spatial_units=UnitData("µm", 1.0 / input_data.meta_data.scale_factor),
            plots=input_data.plots,
        )
def _read ( input_data : CytosimData ) -> TrajectoryData : print ( "Reading Cytosim Data -------------" ) cytosim_data = { } for object_type in input_data . object_info : cytosim_data [ object_type ] = ( input_data . object_info [ object_type ] . cytosim_file . get_contents ( ) . split ( "\n" ) ) dimensions = CytosimConverter . _parse_dimensions ( cytosim_data ) agent_data = AgentData . from_dimensions ( dimensions ) agent_data . draw_fiber_points = input_data . draw_fiber_points uids = [ ] for object_type in input_data . object_info : agent_data , uids = CytosimConverter . _parse_objects ( object_type , cytosim_data [ object_type ] , input_data . meta_data . scale_factor , input_data . object_info [ object_type ] , agent_data , uids , ) for object_type in input_data . object_info : for tid in input_data . object_info [ object_type ] . display_data : display_data = input_data . object_info [ object_type ] . display_data [ tid ] if "fiber" in object_type and ( display_data . display_type != DISPLAY_TYPE . NONE and display_data . display_type != DISPLAY_TYPE . FIBER ) : display_data . display_type = DISPLAY_TYPE . FIBER print ( f"{display_data.name} display type of " f"{display_data.display_type.value} was changed to FIBER" ) agent_data . display_data [ display_data . name ] = display_data input_data . meta_data . _set_box_size ( ) return TrajectoryData ( meta_data = input_data . meta_data , agent_data = agent_data , time_units = UnitData ( "s" ) , spatial_units = UnitData ( "µm", .0  nput_data. m eta_data. s cale_factor) , plots = input_data . plots , )
Return a TrajectoryData object containing the CytoSim data
Return a TrajectoryData object containing the CytoSim data
"""
        Return a TrajectoryData object containing the CytoSim data
        """ # load the data from Cytosim output .txt files # parse # get display data (geometry and color) # create TrajectoryData
input_data
CytosimData