Welcome to iraf.net Monday, May 06 2024 @ 11:29 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 deleting part of an image?
   
Arp
 02/28/2010 04:44PM (Read 3202 times)  
++---
Junior

Status: offline


Registered: 06/15/2009
Posts: 34
Hi!Is there a task which lets me manipulate parts of an image without trimming it? for example, I want to to set all pixel values in a the section 100:200,100:200 to 0.I tried imcopy, but I think that only allows me to copy a section.
thx.

 
Profile Email
 Quote
fitz
 02/28/2010 04:44PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See the IMEDIT or EPIX tasks.There are other ways to do this using expressions or masks, but in the simple case you gave those should work.

 
Profile Email
 Quote
Arp
 02/28/2010 04:44PM  
++---
Junior

Status: offline


Registered: 06/15/2009
Posts: 34
thanks. Ill try those.I found imreplace in the meantime, but it somehow just does nothing...

 
Profile Email
 Quote
valdes
 02/28/2010 04:44PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
Hi,IMREPLACE with an image section would have been my first recommendation. A test I did showed it working so maybe there was a parameter mis-set.The other comment is that people are often unaware of one of the most powerful image tools, IMEXPR. While this is then more difficult to learn, once you understand the syntax and behavior it can do lots of things including setting a rectangular region to some value (use the I,J,K placeholders for positions). For non-rectangular regions you would create a mask, and there are a couple nice mask making tasks with a geometric description language. Then various tools, including IMEXPR, can be used to affect things in or not in the mask.Frank Valdes

 
Profile Email
 Quote
Arp
 02/28/2010 04:44PM  
++---
Junior

Status: offline


Registered: 06/15/2009
Posts: 34
Hello again!I just tried to use imreplace, or epix to change every second pixel in every second line to 0. But it somehow just does nothing...[code:1:b7294495a6]
for(y=1; y<=2016; y+=2)
{
for(x=2; x<=3040; x+=2)
{
epix("b.fits "//x//" "//y//" 0") or alternativly epix("b.fits,x,y,0")
}
}
[/code:1:b7294495a6]when I start the script using cl<b.cl, it does not give any errors, but the file remains unaltered.if I use [code:1:b7294495a6]imreplace("b.fits["//x//":"//x//","//y//":"//y//"] 0")[/code:1:b7294495a6]it asks for the replacement value, and if I enter 0, it replies "Error: FXF: number is not a decimal"Is my syntax wrong?

 
Profile Email
 Quote
fitz
 02/28/2010 04:44PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
If you use the "program mode" syntax (i.e. with the parenthesis rather than more like what you'd type interactively), the parameters must be separate by a comma so they are passed in individiually. Your example epix() command for instance in creating a single long string argument and not individual arguments,

 
Profile Email
 Quote
Arp
 02/28/2010 04:44PM  
++---
Junior

Status: offline


Registered: 06/15/2009
Posts: 34
Hi!Thank you! I tried this and it finally works, although I replace the first for loop with a while loop.
But its horribly slow... to change one line of 1520 pixels, it takes about 20 seconds... that would make 5 hours for a 30240x2016 image...

 
Profile Email
 Quote
   
Content generated in: 0.20 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login