The present invention refers to a pharmaceutical formulation for injection comprising fluorescent nanoparticles as in vivo diagnostics. The present invention relates to an injectable pharmaceutical formulation for human medicine and/or veterinary use, comprising 17% to 20% per weight of poloxamer 407 and 3%-15% per weight of poloxamer 188, 0.10 nM to 10.0 μM fluorescent nanoparticles and water or an aqueous buffer, wherein the pharmaceutical formulation is liquid at 4° C.-32° C. and forms a gel at about 37° C., their use as an in vivo marker and methods of their preparation. The inventive formulation is useful for local control and prevention of spreading/diffusion of nanoparticles, and thus allows full utilization of their quantum physics properties for example as a tool to enable surgical precision of tumor removal; even without tumor specific epitope binding antibodies.