import os
import numpy as np
from simulariumio.cytosim import CytosimConverter, CytosimData, CytosimObjectInfo
from simulariumio import MetaData, DisplayData, DISPLAY_TYPE, ModelMetaData, InputFileData
output_dir = #PATH TO CYTOSIM OUTPUTS
for scale_factor in [1.0,2.0]:
example_data = CytosimData(
meta_data=MetaData(
box_size=np.array([1.0,1.0,0.8]),
scale_factor=scale_factor,
),
object_info={
"fibers" : CytosimObjectInfo(
cytosim_file=InputFileData(
file_path=os.path.join(output_dir,"fiber_points.txt"),
),
display_data={
0 : DisplayData(
name="actin",
radius=0.005,
display_type=DISPLAY_TYPE.FIBER
)
},
position_indices=[1, 2, 3]
),
"solids" : CytosimObjectInfo(
cytosim_file=InputFileData(
file_path=os.path.join(output_dir,"solids.txt"),
),
display_data={
0 : DisplayData(
name="pit",
radius=0.04,
display_type=DISPLAY_TYPE.SPHERE
)
},
position_indices=[5, 6, 7]
),
"singles" : CytosimObjectInfo(
cytosim_file=InputFileData(
file_path=os.path.join(output_dir,"singles.txt"),
),
display_data={
0 : DisplayData(
name="hip1r",
radius=0.005,
display_type=DISPLAY_TYPE.SPHERE
),
1 : DisplayData(
name="linear actin nucleator",
radius=0.005,
display_type=DISPLAY_TYPE.SPHERE
),
2 : DisplayData(
name="myosin",
radius=0.005,
display_type=DISPLAY_TYPE.SPHERE
)
},
position_indices=[3, 4, 5]
),
"couples" : CytosimObjectInfo(
cytosim_file=InputFileData(
file_path=os.path.join(output_dir,"couples.txt"),
),
display_data={
0 : DisplayData(
name="arp2/3",
radius=0.005,
color="#bf95d4",
display_type=DISPLAY_TYPE.SPHERE
)
},
position_indices=[4, 5, 6]
)
},
)
CytosimConverter(example_data).save(os.path.join(output_dir,f'scale_factor={scale_factor}'))
System and Software
Description
The
scale_factorofMetaDatawithinCytosimDatadoes not behave as expected. When I setscale_factor=1.0my data appears correctly oriented in the Simularium viewer, but setting any other value or leaving it to be automatically determined results in different objects being scaled differently from each other and possibly translated relatively to each other as well.Expected Behavior
I expected setting a
scale_factor> 1.0 to make all objects increase in scale by the same amount, so that everything visually looks the same in the viewer but I just don't have to zoom in as far to see it clearly.Reproduction
Using the attached Cytosim outputs (point
output_dirto the directory they are downloaded to in order to reproduce), run the Simularium conversion withscale_factor= 1.0 or 2.0. The first looks fine, the second has different objects scaled inconsistently.singles.txt
couples.txt
solids.txt
fiber_points.txt