How to change T position of all ROIs?

33 views
Skip to first unread message

louise-laure

unread,
Jul 30, 2014, 9:37:43 AM7/30/14
to icy-so...@googlegroups.com
Hello again!

I have a set of ROI generated at position 0 of T frames.
Hence there are all with a position at T=0,
I want to change the T position to "ALL" for all the ROIs at the same time,
meaning how can I select all the ROIs and change the T position of all of them?

Maybe someone with better skills than me will think it's simple with a little script!
Thanks again!

LL

Will Ouyang

unread,
Aug 1, 2014, 5:20:03 AM8/1/14
to icy-so...@googlegroups.com
Hi LL,

Try this:

//change the 5d position of all rois
//set posZ,T to the value you want
//select the rois you want to change 
//for "ALL" just use -1
 
importClass(Packages.icy.type.point.Point5D)
seq = getSequence()
if (seq == null) throw "Please open a sequence first"
rois = seq.getROIs()
if (rois.isEmpty()) throw "No ROI on the sequence"
size = rois.size() 
posZ = -1;
posT = -1;
//posX = 0;
//posY = 0;
for(i = 0;i< size ;i++ )
{
roi = rois.get(i)
if(roi.isSelected())
{
pos = roi.getPosition5D()
pos.setZ(posZ)
pos.setT(posT)
//pos.setX(posX)
//pos.setY(posY)
roi.setPosition5D(pos);
}
}
Good luck! 

louise-laure

unread,
Aug 1, 2014, 10:32:57 AM8/1/14
to icy-so...@googlegroups.com
Works great !
Thanks again!
LL
Reply all
Reply to author
Forward
0 new messages