Closed anoob09 closed 6 years ago
Are you using the Download state
button or some mechanism of your own to save the state? If so, could you share the code?
_I am using download state
button.
Here, I passed the JSON
as string to add_annotation_script.php
_
this.onStateSave=function(){
var e=new H.State;
var new_json = e.toJSON(o);
var myJSON = JSON.stringify(new_json);
jQuery.post("add_annotation_script.php",
{myJSON:myJSON}
);
},
_This is the code for add_annotation_script.php
. Here I am storing the state.json
file in the server._
<?php
if (!file_exists("anno/".$rad_id)) {
mkdir("anno/".$rad_id,0777,false);}
$path = "C:/wamp64/www/MIC/anno/".$rad_id."/".$image.$case_id.".json";
$f = fopen($path, "w+");
fwrite($f, json_decode($myJSON));
fclose($f);
chmod($path, 0777);
$save_path = "http://localhost/MIC/anno/".$rad_id."/".$image.$case_id.".json";
$sql_res= mysqli_query($dbcon, "select * from
annotationswhere
case_id= ".$case_id." and
rad_id= ".$view_id." and
image= '".$image."'");
if(mysqli_num_rows($sql_res)==0) {
$sql_anno = "insert into annotations
(case_id
,rad_id
,image
,path
,submit_id
) VALUES('".$case_id."','".$view_id."','".$image."','".$save_path."','".$rad_id."')";
mysqli_query($dbcon, $sql_anno) or die(mysqli_error($dbcon)); }
I don't think there's problem with code here. I am not understanding why dwv
is not reloading the JSON
file from the provided on the URL
? Why is it still using the old JSON
file?
I turned off cache for the file using .htaccess
and it worked.
For some reason the
JSON
file that I'm using to generate annotations on the DICOM image is being stored in the cache memory of the browser. If I'm making any changes in theJSON
file it is not reflected immediately. I have to clear the cache and load theJSON
file again to see the changes. How can I resolve this?