-
Notifications
You must be signed in to change notification settings - Fork 16
how to load image svs or tif file into quip application
Step 1: download images from where they are stored. This can be done using whatever method you are comfortable with (i.e. sftp, rsync, etc.)
Step 2: move image svs or tif files to your quip distro storage /img folder. It can be in other directories beneath your img folder, but you must account for that in your input_DATE.csv (see below).
Step 3: modify and run following code to generate input_DATE.csv (where DATE is todays date in the format yyyy-mm-dd) file at the /img folder (same folder as step 2). Also replace svs with tif if needed.:
for i in `ls *.svs`; do a=`echo $i | cut -f 1 -d '.'`; \
echo $a,"default","/data/images/"$i; done >> input_DATE.csv
If you are adding multiple subfolders, change the 'ls' command in the for statement to go to the correct subfolder.:
for i in `ls directory1/*.svs`; do a=`echo $i | cut -f 1 -d '.'`; \
echo $a,"default","/data/images/"$i; done >> input_DATE.csv
for i in `ls directory2/*.svs`; do a=`echo $i | cut -f 1 -d '.'`; \
echo $a,"default","/data/images/"$i; done >> input_DATE.csv
One last example is if you have multires tifs under multiple directories that are under one in your img folder. you can do this to cut off the extension and parent directories off the case_id:
for i in `ls newrutgers/*/*-multires.tif`; do a=`echo $i | cut -f 1 -d '.'`; \
b=`echo $a | cut -f 3 -d '/'`; echo $b,"default","/data/images/"$i; done >> \
input_DATE.csv
Note: Test this line without the ">> input_.csv" to make sure the data is correct.
Step 4: get api.key from your viewer container /var/www/html/api.key file
"Step 5: run the following code to load images
docker exec -it quip-loader python3 /root/dataloader/DataLoader/dataLoader/dataloader.py \
-i /data/images/input.csv \
-o http://quip-data:9099/services/Camicroscope_DataLoader/DataLoader/submit/json \
-a 26171da5-da22-4556-bcec-1293f0f23db9
Note: -a 26171da5-da22-4556-bcec-1293f0f23db9
is the api key in your viewer container: /var/www/html/api.key
Step 6: view your_quip_app_url/FlexTables/index.php to confirm that images have been loaded.
The case_id in the csv file needs to match the one in the TIL metadata files for each case_id.